HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- pass parameter containing * to ksh script
Operating System - HP-UX
1829483
Members
1731
Online
109991
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
09-05-2002 01:36 AM
09-05-2002 01:36 AM
pass parameter containing * to ksh script
Hello,
I need a ksh script that copies for example /usr/test/*.txt to /usr/backup/*.bck. I want to use this as parameter for my script but I have problems with the *. How can I manage to pass parameters containing *?
I need a ksh script that copies for example /usr/test/*.txt to /usr/backup/*.bck. I want to use this as parameter for my script but I have problems with the *. How can I manage to pass parameters containing *?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 01:51 AM
09-05-2002 01:51 AM
Re: pass parameter containing * to ksh script
Hi!
You need to protect the '*' from being interpreted by your calling shell.
This can be done e.g. using \ or quotes.
./script "/usr/test/*.txt" "/usr/backup/*.bck"
./script /usr/test/\*.txt /usr/backup/\*.bck
Regards...
Dietmar.
You need to protect the '*' from being interpreted by your calling shell.
This can be done e.g. using \ or quotes.
./script "/usr/test/*.txt" "/usr/backup/*.bck"
./script /usr/test/\*.txt /usr/backup/\*.bck
Regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 02:09 AM
09-05-2002 02:09 AM
Re: pass parameter containing * to ksh script
You can turn off globbing with "set -f"
Once you issue a "set -f", * will not be expanded until you issue a "set +f"
Hope this helps.
Once you issue a "set -f", * will not be expanded until you issue a "set +f"
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 04:19 AM
09-05-2002 04:19 AM
Re: pass parameter containing * to ksh script
Hi
The -f is good or
set -o noglob
Do it before you run the script and
set +f or set +o noglob
after.
-f Disables file name generation.
noglob Same as -f
steve steel
The -f is good or
set -o noglob
Do it before you run the script and
set +f or set +o noglob
after.
-f Disables file name generation.
noglob Same as -f
steve steel
If you want truly to understand something, try to change it. (Kurt Lewin)
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