Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To put some lines ander a specific line

Status
Not open for further replies.

vti

Technical User
Feb 26, 2001
189
TR
Hi
I want to put some lines under the trap "" 2 3 5 15 line in a file

Lines is gonna be like

if test -s /usr/users/test/STOP/
then
clear
echo "\n\n\n\t\t You can not login at the moment
\n\t\t Press ENTER to Continue \c"
read continue
exit
fi

But it shouldn't replace any line in the file ,it has to create new lines and print them there.

Thanks for any help

 
Lots of ways to do this - here's one (untested & not Awk ! )
Type your new lines into a file called infile
then
for filen in `ls myfiles_to_change`
do
vi $filen<< EOF
/trap &quot;&quot; 2 3 5 15
:r infile
:wq
EOF
done


HTH
Dickie Bird (:)-)))
 
It works well
thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top