bash for loop

Tassos Bassoukos abas at aix.meng.auth.gr
Sun Mar 11 15:18:01 EET 2001


On Sat, 10 Mar 2001, Alex wrote:

> Erwthsh gia bash:
>
> 8elw na kanw, px, untar 10 tar files pou onomazontai fileN.tar
>
> anti gia to ekshs aparadekto (pou einai axrhsto gia megala plh8h):
>
> for i in 1 2 3 4 5 6 7 8 9 10
> do
> tar xvf file$i.tar
> done
>
> pws mporw na exw ena pio chic iteration loop sto for statement?
>
> kati tou styl for(i=0;i<10;i++) ths C++ psaxnw
>
> TIA
>
> Alexandros

kane kati se bash:

for tarfile in file*.tar; do
  tar xvf $tarfile
done

Pws to blepeis?

Tassos

PS: se exei ephreasei h C...

-- 
Bassoukos Tassos   +30 31 996011 / +30 93 7109954       IT Generalist

When you design user interfaces, it's a good idea to keep two principles in mind:
1.Users don't have the manual, and if they did, they wouldn't read it.
2.In fact, users can't read anything, and if they could, they wouldn't want to.




More information about the Linux-greek-users mailing list