October 31st, 2012, 12:25 PM
Having a problem with shift
Hello, I made a very simple program on the vi for a homework. However, whenever I try to run it, it tells me the specific number is not valid for this command, referring to shift. It looks like this:
while [ $count -le 12 ]
count=`expr $count + 1`
I tried searching everywhere for an answer but no luck. Any suggestions?
Last edited by Meatsawce; October 31st, 2012 at 12:45 PM.
Reason: Error in the code
October 31st, 2012, 02:28 PM
Have you tried looking it up in the manual?
Originally Posted by Meatsawce
Shift positional parameters to the left by n.
n : The number of parameters to shift (default = 1)
The positional parameters from
n+1 ... $#
are renamed to
$1 ... $#-n+1
Parameters represented by the numbers $# to n+1 are unset.
n must be a positive number less than or equal to $#.
The return status is zero unless n is greater than $# or less than zero.
shift is a builtin command.
October 31st, 2012, 06:57 PM
Also, probably a transcription glitch ...
count=o <-- that's a letter, not the number!
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
November 1st, 2012, 12:35 PM
Good catch Hilaire!!!