HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ksh alias with argument
Operating System - HP-UX
1832255
Members
2492
Online
110041
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-21-2002 01:55 AM
03-21-2002 01:55 AM
ksh alias with argument
Hello,
i try to reduce typing by setting up an alias. The problem is that i don't know how to use an argument in an alias.
E.g. i try to replace the command:
mv filename /daten/bx/ABC.drw/ABC1001.drw
with an alias like
bxABC1001 filename
the alias would look something like:
alias bxABC1001='mv xxx /daten/bx/ABC.drw/ABC1001.drw'
Where xxx should be substituted with the argument.
Any hints? Any documents who describe alias better than the man pages?
Thanks in advance
Stefan
i try to reduce typing by setting up an alias. The problem is that i don't know how to use an argument in an alias.
E.g. i try to replace the command:
mv filename /daten/bx/ABC.drw/ABC1001.drw
with an alias like
bxABC1001 filename
the alias would look something like:
alias bxABC1001='mv xxx /daten/bx/ABC.drw/ABC1001.drw'
Where xxx should be substituted with the argument.
Any hints? Any documents who describe alias better than the man pages?
Thanks in advance
Stefan
No Mouse found. System halted. Press Mousebutton to continue.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2002 02:13 AM
03-21-2002 02:13 AM
Re: ksh alias with argument
Hi,
In my opinion that is not possible (at least not in the way you want it). The following thread covers this issue :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x996e7e990647d4118fee0090279cd0f9,00.html
Hope this helps,
Tom Geudens
In my opinion that is not possible (at least not in the way you want it). The following thread covers this issue :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x996e7e990647d4118fee0090279cd0f9,00.html
Hope this helps,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2002 02:20 AM
03-21-2002 02:20 AM
Re: ksh alias with argument
alias test='set +u;mv $1 /daten/bx/ABC.drw/ABC1001.drw ; set -u'
After this use the following to move filename
test filename
Ciao
Federico
After this use the following to move filename
test filename
Ciao
Federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2002 02:42 AM
03-21-2002 02:42 AM
Re: ksh alias with argument
Hi,
Frederico:
don't use "test" as name for an alias for the move- command, test is also a command!!
Stefan:
hi Stefan,
i would prefer to make a function for this, you can put this function into a file with the same name as the function and use it as often as you want:
function mover
{
mv $* /your/desired/target/directory
}
This function can be used the following way:
mover file1 file2 file3 file4 .....
Remember, how to create the function:
vi mover (*must* be the same name than function)
put the line : mover $* under the function. As root, make sure, that the directory of the function is part of your PATH!
PATH=$PATH:/path_to_your_function
This will do it for you!!
Allways stay on the bright side of life!
Peter
Frederico:
don't use "test" as name for an alias for the move- command, test is also a command!!
Stefan:
hi Stefan,
i would prefer to make a function for this, you can put this function into a file with the same name as the function and use it as often as you want:
function mover
{
mv $* /your/desired/target/directory
}
This function can be used the following way:
mover file1 file2 file3 file4 .....
Remember, how to create the function:
vi mover (*must* be the same name than function)
put the line : mover $* under the function. As root, make sure, that the directory of the function is part of your PATH!
PATH=$PATH:/path_to_your_function
This will do it for you!!
Allways stay on the bright side of life!
Peter
I'm learning here as well as helping
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP