- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- dtksh vs ksh behavior
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
тАО04-19-2011 06:06 AM
тАО04-19-2011 06:06 AM
#!/usr/dt/bin/dtksh
cat /usr/local/prod/data/prod_hp_server_list.txt|while read nm
do
if [[ "B.11.31" != "$(ssh $nm uname -r)" ]]
then
echo "Host $nm is $(ssh $nm uname -r)"
else
echo "Host $nm is 31"
fi
done
Solved! Go to Solution.
- Tags:
- dtksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2011 06:22 AM
тАО04-19-2011 06:22 AM
Re: dtksh vs ksh behavior
differently, but one thing I wouldn't do in
my script is run the "ssh" job twice to get
the same result in two places.
rem_ver="$(ssh $nm uname -r)"
Then test and/or display "rem_ver".
I don't know if it would help, but you might
try something more like:
(
while read nm
[...]
) < /.../prod_hp_server_list.txt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2011 06:23 AM
тАО04-19-2011 06:23 AM
Re: dtksh vs ksh behavior
Two comments. The HP 'ksh' shell is a Korn88 shell whereas the 'dtksh' is based on Korn93. This is true at least the last time I looked.
Secondly, you would be advised to add '-n' to your remote command:
# ssh -n $nm uname -r
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2011 06:45 AM
тАО04-19-2011 06:45 AM
Re: dtksh vs ksh behavior
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2011 08:14 AM
тАО04-19-2011 08:14 AM
Re: dtksh vs ksh behavior
something strange happens to the read buffers when you remote ssh into a server and come back to the same shell. I can not think of any reason why but as if, when you go out to the remote system, your local read buffers get flushed out. Hence when you return, there is nothing in the buffer to loop through. No logical explanation though.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2011 08:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2011 11:21 AM
тАО04-19-2011 11:21 AM
Re: dtksh vs ksh behavior
Could you make sure you're assigning points to resposnes as indicated in the rules of the forum
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-20-2011 11:20 AM
тАО04-20-2011 11:20 AM