answersLogoWhite

0


Best Answer

Something like this, using perl:

perl -e "if (lc("$str1") ge lc("$str2")) { exit 1 } else { exit 2 }"

This will return 1 if $str1 is greater or equal $str2, 2 otherwise. You can then check the value in $?.

User Avatar

Wiki User

16y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to compare strings irrespective of their case in shell programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Whynot you use any onther programming except shell programming?

Shell programming can get you only so far; after that you need to use another programming language (possibly even another scripting language) to get the job done. Shell programming is designed to work with the system interface and to help automate tasks; it isn't good for everything.


Why are there white strings attached to egg yolks?

Chalazae (white strings) are there to anchor the yolk in the centre of the egg shell.


What is the difference between the Linux shell and C?

C is a programming language. A shell is an interface.


What are the types of shells in shell programming?

The Bourne shell (sh) ,The C shell (csh) ,The Korn shell (ksh) ,The Z-Shell (zsh) ,The POSIX shell,The Bourne Again SHell (Bash)null


What is the importance of Linux shell?

Linux shell is a programming language. its fully different from others progrmming language. the script which is used in Linux quite tough to remember if we comparison to other programming laguages.


Sum of n numbers in shell programming?

2 4 6


Difference between c and shell programming execution?

Can you please explain your question?


Shell sript programming Has a bit of a bad press?

Maybe, but don't worry to much about that.


Why is Unix useful in shell programming?

The shell is both a command language and a programming language that provides an interface to the UNIX operating system (Bourne, 1978). The shell is the part of the operating system that the user interacts with, and is arguably the most important part of the operating system. Files can be created, renamed, moved and read from the shell. Computer hardware can be installed, used and removed through the shells. Program applications and scripting can be written, compiled, and ran through the shell.


What are the five characters that have special meaning to the shell?

In shell scripting (for example, Unix C Shell or Bourne Shell programming), some characters have special meaning to the shell, and can't be gracefully employed in text strings without 'escaping' them (preceding them with a backslash (\) to prevent the shell from reading them as commands. There might be much dispute over which five it is to which this question refers. These are the *backslash (escape) \ *pipe (joins two commands) | *dollar sign (specifies a variable) $ ampersand ('and' sign, joins commands) & exclamation point (wildcard) ! asterisk (wildcard) * *pound sign (comment only - do not run) # *semicolon (begin new line/command) ;


How do you modify skin of SPD shell v3.88 for s60 v5?

To modify the skin of the SPD shell v3.88 for s60 v5 you need to have some programming skills.


What can i do with the shell of an upright piano that doesn't work anymore?

Take out "guts" the sound board (strings) and the keys and install a digital keyboard in its place and still keep the shell of the original piano