- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: rsh failing when passing special characters as...
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
тАО03-07-2007 07:23 PM
тАО03-07-2007 07:23 PM
I hav a script hich is doing some thing like this ..
/usr/bin/rsh -n $SERVER_IP "ksh -c \"cd /opt/abc/efg/;./myscript $NODE $KEY $DISPLAY $NAME $VERSION $PATH
now if the parameter NAME is having some special character in it ( like _ , $, @ ,/) then rsh is failng
Can an one help me with this
Regards
Binu
Solved! Go to Solution.
- Tags:
- remsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2007 08:22 PM - edited тАО07-30-2011 07:25 PM
тАО03-07-2007 08:22 PM - edited тАО07-30-2011 07:25 PM
Solutionrsh on HP-UX is the restricted shell, I assume you mean remsh?
Why are you bothering to use ksh inside a remsh? Are you worried that the user on the other side is using the scummy C shell?
You should be able to use:
remsh $SERVER_IP -n "cd /opt/abc/efg/; ./myscript $NODE $KEY $DISPLAY $NAME $VERSION $PATH"
You may have problems if $NAME has a "$" but "_" and "@" should be ok. (Unless "@" is used as erase?)
This will let you pass an embedded "$" to myscript:
$ NAME='x$x'; remsh $SERVER_IP -n "... ./myscript '$NAME' "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2007 10:26 PM
тАО03-08-2007 10:26 PM
Re: rsh failing whn passing special characters as its argument
one more doubt .if NAME is having $ remsh will fail ?? can u pls tell me y its like this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 12:04 AM
тАО03-09-2007 12:04 AM
Re: rsh failing whn passing special characters as its argument
echo /usr/bin/rsh -n $SERVER_IP "ksh -c \"cd /opt/abc/efg/;./myscript $NODE $KEY $DISPLAY $NAME $VERSION $PATH
The echo will show you what is REALLY going to processed. If you see special characters in $NAME, then they will also be expanded and interpreted --> on the remote machine's ksh shell.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 12:39 AM
тАО03-09-2007 12:39 AM
Re: rsh failing whn passing special characters as its argument
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2007 08:23 AM - edited тАО07-30-2011 07:24 PM
тАО03-09-2007 08:23 AM - edited тАО07-30-2011 07:24 PM
Re: rsh failing when passing special characters as its argument
>what will be the impact of removing this ksh -c from my command ???
As I said, if your remote system doesn't have the same shell.
The benefit is that you don't have to have an extra level of quoting. It took at least a few minutes to find my solution, adding more levels takes more fiddling.