Get the nth positional argument in bash?

Positional argument can be obtained in bash by creating the following file

#!/bin/bash
n=2 echo ${!n}

Running that file in the following way: 

./file.sh sun mon tue wed

will print mon

The next one also gives the same result 

eval echo \${$n}

Comments

Popular posts from this blog

VMD High Resolution Image and Movie

Inset Plot in GRACE (Xmgrace)