- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Pass a parameter that contains a dollar sign
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
тАО06-02-2006 06:54 AM
тАО06-02-2006 06:54 AM
Re: Pass a parameter that contains a dollar sign
echo "12345.k" | /usr/lbin/makekey | sed s/\\$/\\\\$/g
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2006 03:09 AM
тАО07-14-2006 03:09 AM
Re: Pass a parameter that contains a dollar sign
solution is vastly simpler than all of the
other suggestions.
When the first script calls the second,
it need only place the encrypted string in
single quotes. This will prevent any attempt
to interpret the argument as a shell variable.
tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2006 05:21 AM
тАО07-14-2006 05:21 AM
Re: Pass a parameter that contains a dollar sign
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2006 08:13 AM
тАО07-14-2006 08:13 AM
Re: Pass a parameter that contains a dollar sign
the whole problem is that this is not a constant; that would be easy. Instead it's a variable that may happen to include the "$" metacharacter
Yes, I also thought it was as simple as Tim said.
Here are my two scripts:
$ more dollar_parm
#!/usr/bin/ksh
ABC=$(echo '$def/sam') # generate key
echo $ABC
dollar_parm2 "$ABC" # quotes not needed
$ more dollar_parm2
#!/usr/bin/ksh
echo $1
Both scripts echo: $def/sam
It seems that once you get a $ in a parm, it will stay there. So you should be able to capture the output of makekey and pass that.
- Tags:
- variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2006 08:57 AM
тАО07-14-2006 08:57 AM
Re: Pass a parameter that contains a dollar sign
I too, think the issue is somewhat easier than Clay avers.
create encrypted password using makekey, assigning same to a variable name. Call subsequent script with this variable as an arguement.
An interactive example:
#!/bin/sh
read password
my_key=`echo ${password}|/usr/lbin/makekey`
;# now call subsequent script with my_key
next_script ${my_key}
next_script then can act on $1 (or whichever arguement was passed)
If you desire to reassign $1 to some other more logically named variable, that is done normally
newpass=$1
when using newpass, just enclose with brackets as was done with my_key in the first script.
- « Previous
-
- 1
- 2
- Next »