Bash loop delimiter
Posted by valqk on
Setting
IFS=\n
at your bash prompt will set the delimiter a for loop uses to a newline.
You can do:
OLDIFS=$IFS;
IFS="--a--";
for i in `cat $somefile`;
do
echo $i;
done
IFS=OLDIFS;
IFS=\n
at your bash prompt will set the delimiter a for loop uses to a newline.
You can do:
OLDIFS=$IFS;
IFS="--a--";
for i in `cat $somefile`;
do
echo $i;
done
IFS=OLDIFS;
Trackbacks
Trackback specific URI for this entryThis link is not meant to be clicked. It contains the trackback URI for this entry. You can use this URI to send ping- & trackbacks from your own blog to this entry. To copy the link, right click and select "Copy Shortcut" in Internet Explorer or "Copy Link Location" in Mozilla.
No Trackbacks
Comments
Display comments as Linear | ThreadedNo comments