Hi,
thanks for your reply - no it's not a homework. I would like to create a script for SAP application that can be used for mass transportation.
To be more precise the command would like the following:
tp import <field1> client<field2> u2368
the script should be able to read the parameter file from where field1 (transport number) and field2 (target client) may be inserted into the above pattern an execute it.
while read line
do
fullcommand=${command_part1}" "(here I should get field1)" "${command_part2}" "(here I should get field2)" "${command_part3}
`$fullcommand`
if ($? -gt 0); then exit 8
fi
done < filename.txt
the reason I don't want to use AWK is curiosity plus I need to check the return code of the last command. If I used AWK, I could more simply do the field separation and can use the system command to execute commands but I'm not sure how to check the return code within AWK (hence my second off topic question in my original post)
I would like to know is there any way apart from AWK or SED to split the $line string into two fields, where the field seperator is a space " ". It can be comma or whatever is more comfortable.