- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Setting alias in a script to be use on cmd line in...
Operating System - Tru64 Unix
1748244
Members
3807
Online
108760
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
Discussions
Discussions
Forums
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
тАО08-08-2003 08:53 PM
тАО08-08-2003 08:53 PM
Hi,
I trying to set an alias that would be accessible from the command line in a shell script that would read the user input.
We need to manually monitor a backup that have the date in the log file. So instead of typing the long alias everyday I wrote a script that would set the alias.
The script would be run, the date entered and than the log file would be view with more.
We set bf to monitor files sytem backup and bo to monitor os backup.
Unfortunately, once the script is executed the alias do not work on the command line.
I receive the message: ksh: bf not found
I thought that using alias -x in the script would do the trick but unfortunately it does not work.
Any ideas or pointer would be great !
Here is the script:
#!/bin/ksh
clear
echo "Please enter the backupfs and backupos date (ddmmyy):"
read backupdate
# Create the alias for backupfs and backupos
alias -x bf='more /usr/it/custom/apps/backup/log/$backupdate.fslog'
alias -x bs='more /usr/it/custom/apps/backup/log/$backupdate.oslog'
echo "The alias were create"
echo "You can now issue bf and bo to monitor the backup"
Thanks,
JP
I trying to set an alias that would be accessible from the command line in a shell script that would read the user input.
We need to manually monitor a backup that have the date in the log file. So instead of typing the long alias everyday I wrote a script that would set the alias.
The script would be run, the date entered and than the log file would be view with more.
We set bf to monitor files sytem backup and bo to monitor os backup.
Unfortunately, once the script is executed the alias do not work on the command line.
I receive the message: ksh: bf not found
I thought that using alias -x in the script would do the trick but unfortunately it does not work.
Any ideas or pointer would be great !
Here is the script:
#!/bin/ksh
clear
echo "Please enter the backupfs and backupos date (ddmmyy):"
read backupdate
# Create the alias for backupfs and backupos
alias -x bf='more /usr/it/custom/apps/backup/log/$backupdate.fslog'
alias -x bs='more /usr/it/custom/apps/backup/log/$backupdate.oslog'
echo "The alias were create"
echo "You can now issue bf and bo to monitor the backup"
Thanks,
JP
Open your Mind and use Open Source software...
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2003 07:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2003 03:59 PM
тАО08-09-2003 03:59 PM
Re: Setting alias in a script to be use on cmd line in ksh.
Hi,
Thanks Micheal,
it's working if I call the script like this:
#. script
Thanks,
JP
Thanks Micheal,
it's working if I call the script like this:
#. script
Thanks,
JP
Open your Mind and use Open Source software...
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP