Any idea what these scripts do?
Any idea what these scripts do? I coudn't get the count command to work. :(
#!/bin/bash string="The quick brown fox jumped over the lazy dog" for i in `count 5 20` do echo $string | cut –c $i done #!/bin/bash low_val=$1;high_val=$2 while [ $low_val -le $high_val ] do echo -n $low_val " " low_val=`expr $low_val + 1` done |
This is a question we had in class today and no one knew.
|
Anyone?
|
They are made for walking up a ladder from the fist step ( val_low ) to the top ( val_high ) and printing the results.
This is the ladder for the first part low_val=`expr $low_val + 1` This is the ladder for the second part for((i=5; i<=$high_val; i++)) You can't use $low_val here as it is actually a much higher value than you might expect. You can show that by putting a couple of echos statements in the code .... echo $low_val echo $high_val for((i=5; i<=$high_val; i++)) Code:
#!/bin/bash |
Quote:
|
Or don't make two identical posts in two different forums!
|
It wasn't homework, just a question that was posed and I apologize for any headaches.
|
All times are GMT -5. The time now is 10:00 PM. |