- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Valuating remote values ...
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
Forums
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
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-06-2007 10:24 AM
06-06-2007 10:24 AM
how can i to valuate remote answers, i mean, i'm valuating the following:
if [[ ! -s `remsh $ip_test_server_atlun31 "uname -a;/usr/bin/ls /interface/${a}/${z}"` ]] ; then
remsh $ip_test_server_atlun31 "uname -a;/usr/bin/mkdir /interface/${a}/${z}"
fi
if i do above written , can i know if the remote folder exist?
i run that and i could system could not work well because answer to me that directories already exist ...
mkdir: cannot create /interface/AM/LOG: File exists
please let me know.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2007 11:18 AM
06-06-2007 11:18 AM
Re: Valuating remote values ...
if [[ ! -s `remsh ...
is trying to use the local shell's -s Conditional Expression operator to test the existence of the file (or directory)...
but it won't work that way. It is going to test for a file on the local system, I guess a file with the name(s) if any returned by the remsh uname and ls commands. But then if your if statement evaluates you're trying to run a mkdir command to create a directory on the remote system.
You need a different approach...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2007 01:03 PM
06-06-2007 01:03 PM
SolutionCollect the return status of your test for the presence of a directory on the remote server in a _local_ file. Then read the local file and examine the return code from the test made on the remote server. For example:
remsh somehost -n '[ -d /somehost_dir ];echo $?' > /tmp/result
[ "$(< /tmp/result)" != 0 ] && echo "dir is absent" || echo "dir is present"
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2007 01:19 PM
06-06-2007 01:19 PM
Re: Valuating remote values ...
you know i did the following:
v=`remsh $ip_test_server_atlun31 "uname -a;/usr/bin/ls -d /interface/${a}/${z}" | grep -v HP-UX`
if [[ $v != "/interface/${a}/${z}" ]]; then
remsh $ip_test_server_atlun31 "uname -a;/usr/bin/mkdir /interface/${a}/${z}"
fi
any way i have learnt other way for doing it .. the way that you have told me !!!
:0) .... thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2007 05:02 PM
06-06-2007 05:02 PM
Re: Valuating remote values ...
In the above case, you would pass in $a and $z to your remote script and it would do the mkdir.
Or better yet, just do mkdir -p, and you don't care if it already exists.