Skip to main content
Removed irrelevant parts, added note that the assignment is not portable
Source Link
Palec
  • 13.4k
  • 8
  • 74
  • 141

I've just spent over 2 hours trying to solve this for aFor tcsh script and my solution turned out to be pretty simple...:

set X = `echo $* | awk -F " " '{print $NF}'`
somecommand "$X"

I'm quite sure this would be a portable solution, but I'm not that experienced with scripting yet..except for the assignment.

Hope it helps someone anyway,

Vince

I've just spent over 2 hours trying to solve this for a tcsh script and my solution turned out to be pretty simple...

set X = `echo $* | awk -F " " '{print $NF}'`
somecommand "$X"

I'm quite sure this would be a portable solution, but I'm not that experienced with scripting yet...

Hope it helps someone anyway,

Vince

For tcsh:

set X = `echo $* | awk -F " " '{print $NF}'`
somecommand "$X"

I'm quite sure this would be a portable solution, except for the assignment.

Source Link
Perfect64
  • 179
  • 1
  • 6

I've just spent over 2 hours trying to solve this for a tcsh script and my solution turned out to be pretty simple...

set X = `echo $* | awk -F " " '{print $NF}'`
somecommand "$X"

I'm quite sure this would be a portable solution, but I'm not that experienced with scripting yet...

Hope it helps someone anyway,

Vince