Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all,
I am trying to run the command:
kickstart -w $so -t $task -c Close
for the file which contains data as follows:
SO20031201005571 3EB5F70C00000000548C7026
SO20031241021097 3EB5E4EA0000000054927026
SO20031241021143 3EB5E4F30000000054907026
SO20031221015061 3EB2573F0000000042927026 This sodata file contains two fields 1 st field contains value for $so and 2nd field with tab delimiter contains $task value. I tried this with using two for loops but it is unable to take two variables at a time in one command line which I require.
Pl. can anybody will give me solution to this ? Is this necessary to use two for loops? two variables can not use in one for loop?

This script worked fine for me. Uses an until loop so it can adjust for different file size. This script assumes it has 3 files, the datatfile, the kickstart file and this file.
All you would need to change in there is where it says dtf=datafile, just change datafile to the actual datatfle name.
#!/bin/ksh
dtf=datafilex=1
until [[ $x -gt `wc -l $dtf | awk '{print $1}'` ]];do
so=`head -$x $dtf|tail -1|awk '{print $1}'`
task=`head -$x $dtf|tail -1|awk '{print $2}'`
kickstart -w $so -t $task -c Close
x=$(($x+1))
done

Hi:
Given: a data file with two columns tab-delimited:
Why not let the shell do the parsing?
#!/bin/ksh
while read so task
do
kickstart -w $so -t $task -c Close
done data.file
# end script
# this forum wipes out the less than sign
# between the done and data.fileRegards,
Nails

Thank u friend !!!
Below script worked out and I got the result excepted.
thanks again .
shilpa
#!/bin/ksh
dtf=datafilex=1
until [[ $x -gt `wc -l $dtf | awk '{print $1}'` ]];do
so=`head -$x $dtf|tail -1|awk '{print $1}'`
task=`head -$x $dtf|tail -1|awk '{print $2}'`
kickstart -w $so -t $task -c Close
x=$(($x+1))
done

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |