- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- alias command
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-2004 02:26 AM
10-06-2004 02:26 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 02:28 AM
10-06-2004 02:28 AM
Re: alias command
alias
it will tell you all the aliases configured...
Example:
# alias
autoload='typeset -fu'
command='command '
date=/bin/date
functions='typeset -f'
history='fc -l'
integer='typeset -i'
local=typeset
nohup='nohup '
r='fc -e -'
stop='kill -STOP'
suspend='kill -STOP $$'
type='whence -v'
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 02:31 AM
10-06-2004 02:31 AM
Re: alias command
and typeset -f will list the shell functions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 02:33 AM
10-06-2004 02:33 AM
Re: alias command
If I had an alias defined: command='ls -al /user ' When I enter the alias, command
don't execute the ls -al /user but rather display the line so I could modify it if needed to say: ls -al /tmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 02:50 AM
10-06-2004 02:50 AM
Re: alias command
alias cmd="ls -al"
then
cmd /usr
cmd /user
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 03:23 AM
10-06-2004 03:23 AM
SolutionTry as,
$ alias test='echo "ls -l /user going to be executed"; echo "want to change (Y/N)"; read opt; if [[ $opt = "Y" || $opt = "y" ]]; then echo "Enter directory"; read dir; fi; ls -l $dir'
Execution of test will be as,
$ test
ls -l /user going to be executed
want to change (Y/N)
Y
Enter directory
.
It will display all files / directory there.
alias command can be used as shell script there.
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 03:43 AM
10-06-2004 03:43 AM
Re: alias command
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 04:24 AM
10-06-2004 04:24 AM
Re: alias command
# which if for stop whence type
# whereis if for stop whence type
You'll see that if, for and stop are not found at all, and that type is /usr/bin/type. But none of those reports are correct at all. That is not what the shell will do. Now do this:
# type if for stop whence type
if is a keyword.
for is a keyword.
stop is an exported alias for kill -STOP
whence is a shell builtin.
type is an exported alias for whence -v
whence and type will tell you what the shell will do. "whereis type" might lead you to believe that /usr/bin/type will be run but that's incorrect. Instead, the shell will run the command whence -v and whence is a shell built-in.
So always use type to see what the shell will do. This is EXTREMELY important if you have the current working directory in $PATH (a very bad idea). If :. or :.: are in your $PATH, someone can put a script called su in some directory and get you to run it by mistake. type will tell where your su will be found by the current shell and environment.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2004 05:28 AM
10-06-2004 05:28 AM