- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to avoid substitution with string having *...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2017 06:27 AM - edited 03-23-2017 06:44 AM
03-23-2017 06:27 AM - edited 03-23-2017 06:44 AM
Hi,
Here is my script
function myfunction {
__TEXT=`echo "$1"`
echo "__TEXT=${__TEXT}"
}
__AA="*** Erreur dans le passage du nombre d'arguments"
myfunction ${__AA}
My question: How to get this as an output from this script:
*** Erreur dans le passage du nombre d'arguments
Instead of this, it returns a string containing filenames !!!
Note: I understand the WHY!!! But I do not know how to do the trick! in other words how to avoid the wildcard expansion ???
Any ideas ? thanks in advance.
Kind regards,
Den.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2017 07:16 AM
03-23-2017 07:16 AM
Solution> Note: I understand the WHY!!!
Perhaps. Perhaps not.
> But I do not know how to do the trick! in other words how to avoid
> the wildcard expansion ???
The usual "trick" is quotation.
> myfunction ${__AA}
myfunction "${__AA}"
Another method might be "set -f". As usual, many things are
possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2017 06:50 PM
03-26-2017 06:50 PM
Re: How to avoid substitution with string having * characters
> __TEXT=`echo "$1"`
What is the purpose of this? Why not: __TEXT="$1"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2017 10:01 PM
03-26-2017 10:01 PM
Re: How to avoid substitution with string having * characters
> > __TEXT=`echo "$1"`
> What is the purpose of this? Why not: __TEXT="$1"
Or even: __TEXT=$1
pro3$ x='aa bb cc'
pro3$ y=$x
pro3$ echo $y
aa bb cc
In more complicated expressions, more quotation may be more helpful.
For future reference:
> Note: I understand the WHY!!!
A statement like this conveys no useful information. What, exactly,
do you know (or believe that you know)? Are you saying that that you
understand how the shell "globs" a "*"? Or that you understand how
quotation works? Or what?
In many cases, the act of forming a question well will itself lead
you to the answer, which can save everyone some work.