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
10-06-2000 05:25 AM
10-06-2000 05:25 AM
i.e. in an script have:
cd /oracle/app/product
but after it is run, I am back to the original directory.
What am I doing wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2000 05:29 AM
10-06-2000 05:29 AM
Re: Script
If you want to influence your current script then you'll have to 'dot' the subscript:-
.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2000 05:31 AM
10-06-2000 05:31 AM
Re: Script
'dot' the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2000 05:32 AM
10-06-2000 05:32 AM
Re: Script
that is because you program gets run as a child process to your shell, so when the program exits, the parent process (your shell) does not remember anything.
you may have to use "exec" to spawn your process. or:
# . your_script
the . (dot) reads your script into your current shell and so it will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2000 05:34 AM
10-06-2000 05:34 AM
Re: Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2000 05:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2000 05:35 AM
10-06-2000 05:35 AM
Re: Script
Do like this:
example: -> the script is /tmp/test_cd
#!/bin/ksh
cd /tmp
# . /tmp/test_cd
I hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2000 05:43 AM
10-06-2000 05:43 AM
Re: Script
You can however run a script within your current shell by typing:-
. sss
This causes your shell to read sss and obey the commands itself. You see it used a lot to condition shell environments for a particular purpose. For example '. oraenv' is used to setup the environment variables etc in an Oracle environment.
I'ts commonly called 'dotting' a script.
For more details (and a better explanation) do 'man sh-posix' and search for Special Commands.
Regards,
John