- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- I've got the subshell blues...
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
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
03-05-2014 05:41 AM
03-05-2014 05:41 AM
I've got the subshell blues...
HP-UX11.31, ksh
So, I have inherited a Korn Shell script that doesn't seem to work. Towards the end of it is the following code...
if [ -d CSC ]
then
echo "Making CSC first..."
( cd CSC ; csc change -A pa_hpux11 ;csc make CGSVERS=8.3.3 CGSROOT=/data/development/cgs-8.3.3/current install ) || exit 1
# above on 1 line
fi
In very simple terms, the line " ( cd CSC ; csc change -A pa_hpux11 ;csc make CGSVERS=8.3.3 CGSROOT=/data/development/cgs-8.3.3/current install ) || exit 1" doesn't do what I expect when it's run in the script, however if I run it from the command line it works fine. Plugging echos and cats into the line, when run in the script...
cd CSC works OK
csc change -A pa_hpux11 works OK
csc make CGSVERS=8.3.3 CGSROOT=/data/development/cgs-8.3.3/current install ) doesn't
BTW, 'csc' is a binary executable, so I can't plug any debug commands into it, however, I have tried subsituting a noddy script for 'csc' which echos the supplied paramenters and they look OK when run from my ksh script.
Any ideas why that line behaves differently when run within a ksh script from when run on the command line?
Many thanks,
Gary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2014 09:36 AM
03-05-2014 09:36 AM
Re: I've got the subshell blues...
>doesn't do what I expect when it's run in the script
What does it do?
>if I run it from the command line it works fine.
This typically occurs because you haven't set up the right env vars. Or you are using aliases.
(I have my ksh ENV file only set if interactive so I can't use aliases in my scripts.)
>I have tried substituting a noddy script for csc which echoes the supplied parameters
That's what I would have done.
You could try using tusc:
tusc -fp -ea -o tusc.out script-name
And compare with the command line version.