gcc

shell program to find smallest string among list of strings(in respect to length)

Asked by sowmya rao

Need to write a shell program to find smallest and largest string(in respect of the string length)among list of 5 strings given by user

Question information

Language:
English Edit question
Status:
Answered
For:
gcc Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jonathan Marsden (jmarsden) said :
#1

Shell programs have nothing to do with gcc; why is this question labelled as being for gcc?

man bash

Please read (and try hard understand) the man page before asking for help here.

For example, in the bash shell you can find the length of a string $STRING with ${#STRING}. You can compare numeric variables with [ $VAR1 -gt $VAR2 ] .

Note: LaunchPad Answers is not intended as a way to get other people to do your school homework assignments for you. This sounds very like a school assignment or similar test question; therefore I am not providing a complete answer here.

Jonathan

Can you help with this problem?

Provide an answer of your own, or ask sowmya rao for more information if necessary.

To post a message you must log in.