The UNIX and Linux Forums
Forum Home
Linux and Unix Man Pages
Search Forums
Search Community Posts
Today's Posts
Quick Links
Man Pages
RedHat Commands
OpenSolaris Commands
Linux Commands
SunOS Commands
FreeBSD Commands
All UNIX Man Pages
All Linux Man Pages
Full Man Repository
Login or Register to Ask a Question and Join Our Community
Search Forums
Show Threads .
Show Posts
Tag Search
Advanced Search
Quick Links
Contact Us
Forum Rules
Today's Posts
FAQ
Pictures & Albums
All Albums
Miscellaneous
What is My IP
Whois
Mark Forums Read
Search Results
Showing results 1 to 1 of 1
Search took
0.01
seconds.
Search:
Posts Made By:
raptor25
Forum:
UNIX for Dummies Questions & Answers
07-15-2011
7
Insert a line in a sorted text file(s)
5,497
Posted By
neutronscott
Like this? for iFile in `ls *.txt` do ...
Like this?
for iFile in `ls *.txt`
do
echo $iFile
nawk -v new="$1" '!done && $0 > new { print new RS $0; done=1; next } 1' $iFile >temp.txt
rm $iFile
mv temp.txt $iFile
done
It...
Showing results 1 to 1 of 1
Member Badges and Information Modal
×