#!/bin/sh
#!/bin/bash
# $IFS .......,..........
output_args_one_per_line(){
for arg
do echo "[$arg]"
done
}
echo; echo "IFS=\" \""
echo "-------"
IFS=" "
var=" a b c tt 12 1"
output_args_one_per_line $var # output_args_one_per_line `echo " a b c "`
# [a]
# [b]
# [c]
echo; echo "IFS=:"
echo "-----"
IFS=:
OFS=P
var=":a::b:c:::" # ......,..." "...":"
echo $OFS
output_args_one_per_line $var
# []
# [a]
# []
# [b]
# [c]
# []
# []
# []
# ..........awk.."FS".....
echo
exit 0
阅读(872) | 评论(0) | 转发(0) |