|
|||||||||||
|
Re: scripting - cat breaking line
From: Matus UHLAR - fantomas <uhlar(at)fantomas.sk>
Date: Sun Jun 24 2007 - 06:49:19 EDT
> I have a file temp1 as below it's not "cat" who is breaking lines. This script will fetch content of "temp1" file to the script, and bash splits fields by any whitespace charactes, including spaces and tabs, so the "echo" command is calles for every "word" in a file and echo puts newline at the end of output line by default. > I get temp2 as either change IFS only to contain newline, or forget using $(cat ...) and use different cycle:
while read line
echo "20070622,$line"
(or >>temp2 if you want to append to the "temp2" file) -- Matus UHLAR - fantomas, uhlar(at)fantomas.sk ; http://www.fantomas.sk/ Warning: I wish NOT to receive e-mail advertising to this address. Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu. Eagles may soar, but weasels don't get sucked into jet engines. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.orgReceived on Sun Jun 24 06:49:38 2007 This archive was generated by hypermail 2.1.8 : Sun Jun 24 2007 - 06:50:02 EDT |
||||||||||
|
|||||||||||