LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   bash scripting - referring to external arguments into loops (http://www.linuxquestions.org/questions/linux-general-1/bash-scripting-referring-to-external-arguments-into-loops-208710/)

linsson 07-23-2004 10:35 AM

bash scripting - referring to external arguments into loops
 
hallo everyone!

Here is a simplified version of my problem:

I have a script and would like it to handle several arguments: a1,a2,a3,a4..................
I usually indicate them with $1, $2, $3.......
i want it to print on screen a2,a3.........


for (( i = 2 ; i < $# ; i++ ))
do
echo :scratch: ????????????????
done

if I write $i it does not work because it prints "i" values and not a1,a2..........
i tried various things but none worked

$[$i] ; $("$"$i"") ; $ $i ; $"$i"

I think there must be an easy answer to write external arguments in a loop but I couldn't find it.

Can anyone help?

Thanks a lot

PS Does anyone know the bash scripting command which plays the role of the BREAK command in c++ ??

DavidPhillips 07-23-2004 12:17 PM

Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

http://www.linuxquestions.org/questi...hreadid=208713

XavierP 07-23-2004 01:24 PM

Closed - as per above.


All times are GMT -5. The time now is 01:16 PM.