I found something interesting just now. I thought that perhaps the problem was with the AWK command. I don't use it much and it always seems to give me a hard time so I'm naturally skeptical of it.
So I took it out and replaced it with a grep command. Grep won't do what I need because it can't sort columns based on a delimiter but it's close enough to test this problem with. The new line was now:
su userID -c
remsh server -l userid -n grep SMITH /tmp/infromational/version74b/LIVE/TEMPORARY/ABCfiles/HLC_Database_File.bat|head -1 > /tmp/variant/45BV32/var/store13.logfnd
Now, at first this still hung until I changed the whole thing to a single line:
su userID -c "remsh server -l userid -n grep SMITH /tmp/infromational/version74b/LIVE/TEMPORARY/ABCfiles/HLC_Database_File.bat|head -1" > /tmp/variant/45BV32/var/store13.logfnd
That worked but I can't seem to make it the same when I use AWK because AWK requires quotes around itself that grep doesn't and remsh when used on the same line as the SU command requires quotes around itself as well. So it ends up looking like this:
su userID -c "remsh server -l userid -n "awk -F^ '\$4 == \"SMITH\"' /tmp/infromational/version74b/LIVE/TEMPORARY/ABCfiles/HLC_Database_File.bat|head -1"" > /tmp/variant/45BV32/var/store13.logfnd
but that many quotes just do not work in the script.
su: illegal option -- F
su: illegal option -- ^
-F^: bad option(s)
And if I remove the quotes from around the AWK command I get this error:
syntax error The source line is 1.
The error context is
>>> == <<<
awk: Quitting
The source line is 1.
And if I remove the quotes from around the remsh call instead I get this error:
su: illegal option -- l
su: illegal option -- n
usage: remsh host [ -l login ] [ -n ] command