- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sending multiple commands to ksh not working in hp...
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
11-09-2004 08:36 PM
11-09-2004 08:36 PM
Im trying to port some of my scripts from tru64 to hp-ux, but I got stuck on a simple thing like this. If I do : ksh "cd / ; ls" in tru64 or in Solaris it gives me the listing for /, but in hp-ux it says: "ksh: cd / ; ls: cannot open"
Why is that so, and how can I fix it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 08:45 PM
11-09-2004 08:45 PM
Re: sending multiple commands to ksh not working in hp-ux
# sh "cd / ; ls"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 08:54 PM
11-09-2004 08:54 PM
Re: sending multiple commands to ksh not working in hp-ux
ksh -c "cd / ; ls"
Then it knows its a command
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 08:54 PM
11-09-2004 08:54 PM
Re: sending multiple commands to ksh not working in hp-ux
What about:
ksh "$(cd /;ls)"
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 08:55 PM
11-09-2004 08:55 PM
Re: sending multiple commands to ksh not working in hp-ux
Use '-c' option to specify a command or a set of commands.
ksh -c "cd /;ls"
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 08:56 PM
11-09-2004 08:56 PM
Solutionksh -c "cd / ; ls"
-c option tells ksh to run a command then exit.
Note that running
cd / ; ls
(without running a new ksh) will do the same thing.
Another thing, look at those man pages :
sh-bourne(1) Bourne Shell (/usr/old/bin/sh)
ksh(1) Korn Shell (/usr/bin/ksh)
sh-posix(1) POSIX Shell (/usr/bin/sh)
If you port from sun, you'd better use sh as it is posix shell, as ksh on sun.
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 08:58 PM
11-09-2004 08:58 PM
Re: sending multiple commands to ksh not working in hp-ux
echo "cd / ; ls" | ksh
should do it too.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2004 09:03 PM
11-09-2004 09:03 PM