![]() |
|
|
google unix.com
|
|||||||
| Forums | Casino | Register | Forum Rules | Links | Albums | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need to invoke a shell script from xml file. | sais | UNIX for Dummies Questions & Answers | 2 | 05-19-2008 01:01 PM |
| cd from a Bourne Shell Script - Please Help | fawqati | Shell Programming and Scripting | 10 | 05-25-2006 03:26 AM |
| how to invoke shell script | gopa_mani | Shell Programming and Scripting | 1 | 12-30-2005 10:43 PM |
| Bourne Shell Script | dmhonor914 | UNIX for Dummies Questions & Answers | 2 | 12-10-2003 11:25 AM |
| Bourne shell script need help please ? | dezithug | UNIX for Advanced & Expert Users | 7 | 10-24-2001 01:59 PM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Bourne: How to invoke an alias from within a shell script
Bourne: How to invoke an alias from within a shell script
If I type in the alias in the command line, it runs If I insert that same alias into my shell script and run the shell script, the alias is not invoked. Help please. |
| Sponsored Links |
|
||||
|
Exporting aliases is shaky at best, and what can be achieved can only be achieved with the Korn shell, not Bourne.
See this. Here is an excerpt... Exporting aliases works in much the same way as exporting variables with export. But, ksh will only export an alias to another shell that is not a separate invocation of ksh (an exported alias will survive a fork(2), but not an exec(2)). Exported aliases are available to subshells, for example, ( prog ), and to shell scripts that do not start with #!/bin/*. You can export aliases interactively or from within your .profile or .kshrc. To do so type, or add to the appropriate file: alias -x who='who | sort' Then, when you type alias or alias -x, who=who | sort is shown. Cheers ZB |
![]() |
| Bookmarks |
| Tags |
| None |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|