bash: Field Separator Variable
By default when using a for loop in bash the field separator is set to a space.
Example:
[bcane@bcane ~]$ for x in list:like:this; do echo $x; done
list:like:this
One of the cool things about bash is that you can change this by setting a simple variable $IFS
[bcane@bcane ~]$ IFS=”:”
[bcane@bcane ~]$ for x in list:like:this; do echo $x; done
list like this
7 Notes/ Hide
-
catarina-frost reblogged this from sys-log
-
opentumble reblogged this from sys-log
-
monzell reblogged this from sys-log
-
loganabbott liked this
-
sys-log posted this