Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a question on how to exclude my echo result, currently I'm having a script running:
echo "parameter Value =" $mc_parameter_value >> $TMPFILE
the value is actually causing a problem for me, since the result is giving me unnecessary result, If i have a "*" in the string then it will actually echo the directory content and i don't want this...
So basically I want to exclude reading the "*" in the line.
Since * is a wild card if I put a simple exclusion putting * in there won't it just ignore the whole thing? any one have any idea of doing this?
Please provide more details on how you set the $mc_parameter_value variable.
It would help if we could replicate your results.
If the asterisk is separated by spaces, then evaluating the variable will have the asterisk expand to the files in the directory.
For example: value="abc * def" will will have the asterisk expanded.
For "abc*def", "abc* def", "abc *def" it won't be.
If you put the variable inside double quotes, then the asterisk isn't expanded:
echo "parameter Value = $mc_parameter_value" >> $TMPFILE
Hmmm actually I have never tried to have the not asterix separated, but actually I don't have any control over how the string will look like.
But the value of the parameter value is actually passed over by other application which reads through a content of log then this script will actually capture it and passing it so an email will have this parameter value.
For ex:
Monitoring log application will search for a string "abc * abc", the string matched in a log will trigger a notification and pass it to event monitoring application, from that application the information will be pass over to an email, and this script is filling the information inside that mail.
echo "parameter Value = $mc_parameter_value" >> $TMPFILE is only part of the script.
And yes when the script is echo ing the $mc_parameter_value since it has * in there, it actually echo ing the content of the directory where the script reside.
If you are replying to questions can you please quote them inline so that we can follow what your have answered. It's hard to tell what is your text, where you are quoting someone else, where you are answering specific questions etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.