For Programmers: Free Programming Magazines  


Home > Archive > AWK > September 2006 > Add lines to a file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Add lines to a file
bshah@citadon.com

2006-09-01, 6:56 pm

Hi Gurus,
I need to write a script which adds lines to a file sd.conf as below.
The only problem is target and lun no are different each time. say i
want to add target 5 lun 3 etc...want to do this for multiple pairs at
the same time in for loop. My problem is how to define pair and keep
adding mutiple lines in one script.
TIA


#!/usr/bin/ksh

for .....
cat << EOF >> sd.conf

name="sd" class="scsi"
target="$T" lun="$L";
EOF

done

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com