- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ksh and quotes
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
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
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
тАО07-31-2002 09:28 AM
тАО07-31-2002 09:28 AM
ksh and quotes
The problem I have is passing the quotes.
Here is the command line abc -s 'a b c'
here is abc:
sas $*
What get run is sas -s a b c
AFter I post I will try to look at past items but I know someone with real knowledge will point me to the solution faster than I can find it.
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 09:34 AM
тАО07-31-2002 09:34 AM
Re: ksh and quotes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 09:44 AM
тАО07-31-2002 09:44 AM
Re: ksh and quotes
A character can be quoted (i.e., made to stand for itself) by
preceding it with a \. The pair \new-line is ignored. All characters
enclosed between a pair of single quote marks (''), except a single
quote, are quoted. Inside double quote marks (""), parameter and
command substitution occurs and \ quotes the characters \, `, ", and
$. "$*" is equivalent to "$1 $2 ...", whereas "$@" is equivalent to
"$1""$2" ....
Would that help? Sometimes $* is better, sometimes $@
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 09:45 AM
тАО07-31-2002 09:45 AM
Re: ksh and quotes
Still NG.
I even tries abc '''a b c'''
and that does not work.
Any ksh option that says to pass the whole parameter string as one parameter and do not touch the quotes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 09:46 AM
тАО07-31-2002 09:46 AM
Re: ksh and quotes
I am not sure I have understand this correct but perhaps this work for you:
abc -s \`1 2 3\`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 09:57 AM
тАО07-31-2002 09:57 AM
Re: ksh and quotes
echo :$1:
you would see-
:a b c:
This is because those three letters make up parameter #1. If you wish to quote them again to sas, then use-
sas -s "$@"
This will again pass the three letters as one argument to the shell.
Hope this helps...
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 10:06 AM
тАО07-31-2002 10:06 AM
Re: ksh and quotes
Is there any way to tell if the parameters or command line has the quotes in it so I can use $@ in one case and $* in the other?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 10:09 AM
тАО07-31-2002 10:09 AM
Re: ksh and quotes
This worked for the quoted string but then I tried it where there was no quoted string to pass and then the normal command did not work.
Thats what promted the oither reply.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 10:09 AM
тАО07-31-2002 10:09 AM
Re: ksh and quotes
TEST=\'$*\'
sas $TEST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2002 10:14 AM
тАО07-31-2002 10:14 AM
Re: ksh and quotes
If sas is expecting to see the single quotes, then Ian's example is ok.
If sas is not expecting to see the single quotes, ie the three letters are just the first argument, then you will have to do the following-
eval sas $TEST
But I think this is becoming overkill. Maybe a little more info on what you really are trying to do.
my 2 cents...
-- Rod Hills