Question

Locked

Help required in Shell Script

By homosapien2001 ·
Shell script
1.how to generate the following series ,1,3,2,4,3,5,4,6......100

2.how to write a shell script to check if a given string is palindrome or not (without reversing the string)

3.how to write a shell script to display the following pattern using while loop.
1
22
333
4444

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

I want code of Shell Script of Palindrome

by maheshkarnekar In reply to Help required in Shell Sc ...

Hello Sir,

I want the Code of Shell Script Code to check whether the entered string is palindrome or not.

Collapse -

how to write a shell script to display the following pattern using while

by Sweety_17 In reply to Help required in Shell Sc ...

how to write a shell script to display the following pattern using while loop.
1
22
333
4444


ANS:: I have tried. but i dunno whether is it right or not. check it!!!


i=1
while((i-le 5))
do
j=1
while((j -le i))
do
echo -n "$i"
j++
done
echo " "
i++
done

output:
-------
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums