Hey...

Curious as to how to get the following to work remotely over SSH. The
cmd is used to remove redundant lines, while maintaining order in the
output file.

The following works if I insert it in the remote term.
   cat /dog/aaa.dat | awk '!a[$0]++' > /dog/aaa.dat_tmp


However I'm unable to get the cmd to work via SSH from the local to
the remote. I've tried the following...
ssh  [email protected]  cat /dog/aaa.dat | awk '!a[$0]++' >
/dog/aaa.dat_tmp
ssh  [email protected] ' cat /dog/aaa.dat | awk '!a[$0]++' >
/dog/aaa.dat_tmp '
ssh  [email protected] " cat /dog/aaa.dat | awk '!a[$0]++' >
/dog/aaa.dat_tmp "
ssh  [email protected] ' cat /dog/aaa.dat | awk '\!a[$0]++' >
/dog/aaa.dat_tmp '
ssh  [email protected] " cat /dog/aaa.dat | awk '\!a[$0]++' >
/dog/aaa.dat_tmp "

ssh  [email protected] ' cat /dog/aaa.dat | awk '"\!"a[$0]++' >
/dog/aaa.dat_tmp '
ssh  [email protected] " cat /dog/aaa.dat | awk '"\!"a[$0]++' >
/dog/aaa.dat_tmp "


In some cases, the cmd returns -- bash: !a[$0]++: event not found


In the case
 ssh  [email protected] " cat /dog/aaa.dat | awk '\!a[$0]++' >
/dog/aaa.dat_tmp "
   the return is:
    awk: \!a[bash]++
    awk: ^ backslash not last character on line

The escapsed cmds seem to work, but in reality, only generates the 1st
line in the file!
  ssh  [email protected] " cat /dog/aaa.dat | awk '"\!"a[$0]++'
> /dog/aaa.dat_tmp "


Thoughts/comments???

Thanks
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to