[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] Is there a way to allow `read` get empty field with IFS=$'\t
From: |
Peng Yu |
Subject: |
[Help-bash] Is there a way to allow `read` get empty field with IFS=$'\t'? |
Date: |
Wed, 7 Mar 2018 15:52:49 -0600 |
Hi,
When IFS=$'\t', `read` will not get empty fields like the one between
'a' and 'b c' below. Is there a way to allow it do so? Thanks.
IFS=$'\t' read -r -a a <<< $'a\t\tb c\td'
declare -p a
declare -a a=([0]="a" [1]="b c" [2]="d")
--
Regards,
Peng
- [Help-bash] Is there a way to allow `read` get empty field with IFS=$'\t'?,
Peng Yu <=