HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Return codes from remote commands
Operating System - Linux
1830241
Members
3727
Online
109999
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
09-29-2006 08:14 AM
09-29-2006 08:14 AM
Return codes from remote commands
This should be a simple problem.
I need to test for the existance of a file on a remote host. rsh test -f does not work because not matter what the result of the test command, rsh completes sucussfully ( ie returns 0 ).
I'm checking $?.
Any ideas would be helpful.
I need to test for the existance of a file on a remote host. rsh
I'm checking $?.
Any ideas would be helpful.
Computers are just external storage for my brain.
- Tags:
- remsh
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 08:29 AM
09-29-2006 08:29 AM
Re: Return codes from remote commands
Hi Robert:
Write the result of the file test into a *file* that you fetch to retrieve to determine the success or failure.
Regards!
...JRF...
Write the result of the file test into a *file* that you fetch to retrieve to determine the success or failure.
Regards!
...JRF...
- Tags:
- Test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 08:32 AM
09-29-2006 08:32 AM
Re: Return codes from remote commands
How about this:
filespec=/path/to/file
RESULT=`remsh remotehost "ls $filespec" 2>&1`
if [ "$RESULT" = "$filespec" ]
then
#found the file ... do something
else
# nothing found ... do something else
fi
HTH. Good luck
filespec=/path/to/file
RESULT=`remsh remotehost "ls $filespec" 2>&1`
if [ "$RESULT" = "$filespec" ]
then
#found the file ... do something
else
# nothing found ... do something else
fi
HTH. Good luck
nothing wrong with me that a few lines of code cannot fix!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2006 08:52 AM
09-29-2006 08:52 AM
Re: Return codes from remote commands
Wow that was quick.
Kofi ARTHIABAH your solution is a gem.
I was thinking that I would need to do something like what JRF listed, but your solution is the simple one I needed!
Thank you!
Kofi ARTHIABAH your solution is a gem.
I was thinking that I would need to do something like what JRF listed, but your solution is the simple one I needed!
Thank you!
Computers are just external storage for my brain.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP