[opensuse] Script help
I have the following script to add text to the end of a file (that file is found in ~/Desktop/test). When i run the script it adds the following: text... just like the script has but it adds it on the 2nd to last line and i want to add it to the very end of the file. Not sure how the opensuse list feels about attachments but i have added the script and small test file for you all to run the script on the test file so you can see what is happening. Chris
On Nov 20, 2007 11:24 AM, Chris Arnold <carnold@electrichendrix.com> wrote:
I have the following script to add text to the end of a file (that file is found in ~/Desktop/test). When i run the script it adds the following: text... just like the script has but it adds it on the 2nd to last line and i want to add it to the very end of the file. Not sure how the opensuse list feels about attachments but i have added the script and small test file for you all to run the script on the test file so you can see what is happening.
Chris
To add a text to the end of a file, you can just use: echo "some text" >>myfile -- Svetoslav Milenov (Sunny) Even the most advanced equipment in the hands of the ignorant is just a pile of scrap. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Sunny wrote:
To add a text to the end of a file, you can just use:
echo "some text" >>myfile
That would work except i have over 2000 files to add the same text to :) So the ">>myfile" part of the above code would not be possible; unless, you can have echo "some text" >>*.php? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
% for f in *.php; do echo "some text" >> $f; done On Nov 20, 2007 1:09 PM, Chris Arnold <carnold@electrichendrix.com> wrote:
Sunny wrote:
To add a text to the end of a file, you can just use:
echo "some text" >>myfile
That would work except i have over 2000 files to add the same text to :) So the ">>myfile" part of the above code would not be possible; unless, you can have echo "some text" >>*.php?
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Chris Arnold
-
Razi Khaja
-
Sunny