0

Im writing a script where I am trying to use "set" to parse specific argument out of the "last" command. Whenever I echo the tenth argument it spring "$arg1"0"".

For example Tenth arg is Tuesday First arg is Yesterday

when echo-ing $10 it gives me Yesterday0

${20}
set $(last | head -n 1)

echo
echo $*
echo "Name: $1"
echo "Date: $4 $5 $6"
echo "Time: $7"
echo "Status: $8 $9 $10"
echo

I expect the tenth arg to echo "Tuesday"

Zac Jose
  • 13
  • 3

1 Answers1

0

Use echo ${10}. Curly braces are needed for multi-digit variables.

John Kugelman
  • 330,190
  • 66
  • 504
  • 555
Sniggerfardimungus
  • 11,195
  • 10
  • 49
  • 93