PDA

View Full Version : shell script problem (urgent)


selvam
25th July 2006, 17:04
hi,

if any one give me a code for this output


if i give input 4 means

i want this output


*
* *
* * *
* * * *

actually i am not familier with for loop in shell script .

so that i ask this help to u

send your answer as soon as possible

thanks

falko
26th July 2006, 11:11
Have a look here: http://www.tldp.org/LDP/abs/html/index.html
It should get you started. :)

KenJackson
27th July 2006, 18:47
I implemented this just for fun. But this sounds so much like a homework assignment that I'm only posting a few lines (the looping part) of my solution. #!/bin/sh
...
while [ $n -gt 0 ]; do
...
n=$[n-1]
done Don't forget to make the file executable with 'chmod +x scriptfile'.