- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: simple script is failing
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
тАО03-19-2009 05:15 AM
тАО03-19-2009 05:15 AM
I was running the below script and somehow it dosent work:-
cat myscript.sh
#!/usr/bin/ksh
echo "hello world"
alias 'ps=ps -aef'
alias -x 'bmw=ls -rt'
Globe1>./myscript.sh
hello world
Globe1> bmw
ksh: bmw: not found
Plz advice
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 05:20 AM
тАО03-19-2009 05:20 AM
Re: simple script is failing
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 05:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 05:26 AM
тАО03-19-2009 05:26 AM
Re: simple script is failing
I type alias after running the script
and my alias dosent work...
Plz help me with a small example
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 05:27 AM
тАО03-19-2009 05:27 AM
Re: simple script is failing
I see you are trying to use:
alias -x
I guess with the aim that the alias is propagated to another shell.
This won't work as you've seen. See this part of ksh man page:
Exported aliases remain in effect for subshells but must be
reinitialized for separate invocations of the shell (see Invoking ksh
below).
You would probably be better just sourcing in a file to set them for each new shell:
. /file
HTH, Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 05:28 AM
тАО03-19-2009 05:28 AM
Re: simple script is failing
I have learnt something now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 06:08 AM
тАО03-19-2009 06:08 AM
Re: simple script is failing
Just copy the original to a new name (you will own the new copy)...
cp .profile .profile.new
... delete the original...
rm .profile
... and rename the copy you made back to original name.
mv .profile.new .profile
If the permissions of the file are -r--r--r-- but you are the owner of the file, there is no need to do any copying. You can simply give yourself the write permission:
chmod u+w .profile
MK