sreekesh padmanabhan
sreekesh padmanabhan

Reputation: 45

Fetch last argument of csh source command

say I try following in csh:

  1. source script.csh a b c d

  2. source script.csh a s j

  3. source script.csh a k h s p

I need to get the last argument passed with number of parameters varying per source'ing, Example for d for 1, j for 2, and p for 3. How do I do it in csh?

Thanks

Upvotes: 0

Views: 117

Answers (1)

sreekesh padmanabhan
sreekesh padmanabhan

Reputation: 45

Following I tried worked:

set arg_count = $#

set sim = "$argv[$arg_count]"

Upvotes: 1

Related Questions