Command Line Arguments like $# or $1.. how to increment?- Bourne Shell
Posted on 2011-02-17
Let's say the script is called test.sh
and i run it so it's like "test.sh a b c d e f"
I'm trying to print it so it prints something like
a b c d e f
b c d e f
c d e f
I'm trying something like maybe incrementing $1.. so i can do something like
num=`expr $1 + 1`
but that isn't working... i'm still not sure how i can code this yet, but I'm thinking if I can increment $1, i can figure something out.. is there some way I can do this?
I know of the $# and $@ but I don't think it helps very much.. i'm hoping someone can push me in the right direction