- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- modifying calling environment from ksh script
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
03-27-2001 10:36 AM
03-27-2001 10:36 AM
I can cd to the directory but when the script ends it reverts to the calling environment. I could source the script rather than execute but that is not acceptable. The user will never remember to source it.
Is there any way I can affect the calling environment from within a ksh script?
Thanks.
henry, hwollman@moody.edu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2001 10:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2001 10:59 AM
03-27-2001 10:59 AM
Re: modifying calling environment from ksh script
Here's an example.
1) Create a script myfile ( in your home directory )
# vi myfile
root=/
cd $root
echo "hello"
2) Run the script
# . myscript
3) check your present dir
# pwd
/
4) You should be in the root directory now.
------ fnhalili
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2001 01:39 PM
03-27-2001 01:39 PM
Re: modifying calling environment from ksh script
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2001 06:01 PM
03-27-2001 06:01 PM
Re: modifying calling environment from ksh script
Sorry, but Jesper is right. You will have to source the script. An alias is probably your best bet. Remember, if the user is running the C shell, the command is
source script
and not the "dot".
--Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2001 06:12 AM
03-28-2001 06:12 AM
Re: modifying calling environment from ksh script
Eg. #. <Script-name>