[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: print command



Quoting Bijan Soleymani <bijan@psq.com>:
> Since bash is the default shell in Debian you should be able to open up
> an xterm and type:
> for x in `seq 80`; do echo -n \*; done; echo
Yeah, I sure have a bash and it does work.
 
> Basically this is the bash (or sh) for loop.
> 
> for variable in list; do list of tasks; done
> 
> it takes the list of variables and then runs the list of tasks
> substituting into the variable each time.
> 
> For example:
> bijan@server:~$ for x in 1 2 3; do echo $x; done
> 1
> 2
> 3
> 
> The command "seq n" generates a list of numbers from 1 to n. Enclosing
> it in parenthese makes the shell substitute it in the command line.
Thank to the Vineet Kumar's previous post, I found a more C/C++ friendly use of
for :"for ((i=0;i<80;i++)); do echo -n '*'; done ; echo".
Anyway, thanks a lot, I always enjoy to learn things about GNU tools, it's so
powerfull. I really like it.
I must also say that I a bit suprised. I joined the ml yesterday and didn't
exepect messages as interessant as they are. You all guys are doing pretty good.
Wish you the best.



Reply to: