Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
To guess in script I need to check whether all the characters in the argument are lower case. Could you give me a function that tells, if all the letters in the argument are lower case.
I looked in google to check for that the simple function to check lower case, but its leading to complex codes always.
I want to implement this. Will it work.
Code:
if [check whether $2 is all lower case]
then
COLUMN=$2
else
COLUMN=`\"$2\"`
fi
Last edited by tostay2003; 09-13-2006 at 03:20 PM.
I have a partially humorous suggestion. It is true as FreeDoughnut says that the quotes are removed when the shell processes a command -- at least for bash and other Bourne-shell related shells.
The rc shell handles quotes differently. Here's an example of an rc script being called from an interactive rc shell:
Code:
% rc
; cat r1
#!/usr/bin/rc
# @(#) r1 Demonstrate rc shell quoting.
echo "Hello, world."
echo First argument is $1
; ./r1 "a"
"Hello, world."
First argument is "a"
As you can see, the quotes were passed in and echoed.
The rc shell never really caught on, and the only place I saw it used much was at Thinking Machines (TMC) in Boston. However, it seems to be available in many distributions.
Nice to know perhaps, but, as I said, probably not a serious solution -- and, no, I don't know much more about it than that See your friendly man rc page for details (and it is a pretty good man page) ... cheers, makyo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.