start

Search

You can find the results of your search below.

The read builtin command @commands:builtin
19 Hits, Last modified:
, the line is word-split using [[syntax:shellvars#IFS|IFS]] variable, and every word is assigned to one ''<NAME>''. The remaining words are all assigned to ... the escaping of input which matches something in IFS, and also escapes line continuations. It's explai... using the //special variable// [[syntax:shellvars#IFS | IFS]], the Internal Field Separator. <code> IFS
Parameter expansion @syntax
18 Hits, Last modified:
ist are separated by the first character in the ''IFS''-variable (<space> by default). This will show ... d ''${arr[*]}'' when [[http://mywiki.wooledge.org/IFS | IFS]] is set to null. POSIX is unclear about the expected behavior. A null IFS causes both [[syntax:expansion:wordsplit | word s
Special parameters and shell variables @syntax
14 Hits, Last modified:
word//, delimited by the first character of the ''IFS'' variable (a space in this example): ''"$1 $2 $3 $4"''. \\ If ''IFS'' is unset, the delimiter used will be always a space, if ''IFS'' is NULL, the delimiter will be nothing, which e... tting will split the text again, if it contains ''IFS'' characters. \\ See also the [[scripting:pospara
Handling positional parameters @scripting
8 Hits, Last modified:
.....$N"'', where 'c' is the first character of ''IFS''. But when the ''$@'' special parameter is used... are expanded, separated by the first character of IFS (represented by "c" here, but usually a space): ... tional parameters separated by only space, not by IFS. <code> #!/bin/bash export IFS='-' echo -e $* echo -e $@ </code> <code> $./test "This is" 2 3 This
Word splitting @syntax:expansion
8 Hits, Last modified:
can the results of these expansions for special ''IFS'' characters that mark word boundaries. This is o... double-quoted**! ===== Internal Field Separator IFS ===== The ''IFS'' variable holds the characters that Bash sees as word boundaries in this step. The d... <newline> These characters are also assumed when IFS is **unset**. When ''IFS'' is **empty** (nullstri
The coproc keyword @syntax:keywords
7 Hits, Last modified:
ls thisfiledoesntexist; read; } 2>&1 [2] 23084 $ IFS= read -ru ${COPROC[0]} x; printf '%s\n' "$x" ls: ... pdksh derivatives ls |& # start a coprocess while IFS= read -rp file; do print -r -- "$file"; done # re... bash> #DOESN'T WORK $ coproc ls [1] 23232 $ while IFS= read -ru ${COPROC[0]} line; do printf '%s\n' "$l... awk '{print "foo" $0;fflush()}' [2] 23100 $ while IFS= read -ru ${COPROC[0]} x; do printf '%s\n' "$x";
The classic test command @commands
3 Hits, Last modified:
dotglob ... function RecurseDirs { oldIFS=$IFS IFS=$'\n' for f in "$@" do if [[ -e "$PWD/$FilePattern" ]]; then ## go... A1 ".") cd .. fi done IFS=$oldIFS } ... RecurseDirs $(ls -A1 "$StartPath"
The classic for-loop @syntax:ccmd
2 Hits, Last modified:
ete: You can change the internal field separator (IFS) to a newline and thus make a for-loop iterating over lines instead of words: <code bash> IFS=$'\n' for f in $(ls); do echo $f done </code>
Process substitution @syntax:expansion
2 Hits, Last modified:
<code bash> counter=0 find /etc -print0 | while IFS= read -rd '' _; do ((counter++)) done echo "... for the subshell): <code bash> counter=0 while IFS= read -rN1 _; do ((counter++)) done < <(find
The declare builtin command @commands:builtin
2 Hits, Last modified:
sum { typeset -n _result=$1 _arr typeset IFS=+ _result=0 for _arr in "${@:2}"; do ... tion sum { typeset -n _result=$1 shift typeset IFS=+ _arrx _result=0 for _arrx in "$@"; do
readthesourceluke @misc
2 Hits, Last modified:
riable $REPLY. ksh93 strips leading and trailing IFS whitespace, so that `read x ; echo "$x"' and... tation or modification unless you mess with $IFS (e.g., setting it to the empty string). If y
Bash changes @scripting
1 Hits, Last modified:
| | ''PS1'', ''PS2'', ''PATH'', and ''IFS'' are unsettable | 2.0 |
Pathname expansion (globbing) @syntax:expansion
1 Hits, Last modified:
arate words, no matter how many spaces or other ''IFS''-characters they contain. ===== Normal behavio
Print a random string or select random elements @snipplets
1 Hits, Last modified:
. Values in the array can't contain characters in IFS, or anything that might be interpreted as a patte
Get largest file @snipplets
1 Hits, Last modified:
le :; do for x in cur\[{size,name}\]; do IFS= read -rd '' "$x" || break 2 done if (( c
The let builtin command @commands:builtin
1 Hits, Last modified:
The mapfile builtin command @commands:builtin
1 Hits, Last modified:
Command substitution @syntax:expansion
1 Hits, Last modified:
The case statement @syntax:ccmd
1 Hits, Last modified:
Portability talk @scripting
1 Hits, Last modified:
Print a horizontal line @snipplets
1 Hits, Last modified:
The basics of shell scripting @scripting
1 Hits, Last modified:
Obsolete and deprecated syntax @scripting
1 Hits, Last modified:
Wishlist
1 Hits, Last modified:
  • start.txt
  • Last modified: 2021/03/09 22:56
  • by shigvia