- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to keep special meaning "*" inside a scrip...
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
Discussions
Discussions
Forums
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
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
тАО06-02-2003 06:32 AM
тАО06-02-2003 06:32 AM
SolutionDo you mean that you want to disable or enable globbing (file name generation). If so:
set -f
...disables shell file name generation.
set +f
...enables shell file name generation.
You can certainly choose the option you want inside a script to make it differ (or not) from your shell environent.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2003 07:00 AM
тАО06-02-2003 07:00 AM
Re: How to keep special meaning "*" inside a script
You perhaps want to do something if there is any files. Try the following:
for file in `ls /tmp/ffin* 2>/dev/null`
do
echo $file
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-04-2003 06:47 AM
тАО06-04-2003 06:47 AM
Re: How to keep special meaning "*" inside a script
Try the following :
if [ -f /tmp/ffin* ]; then
echo 'Found files'
fi
regards,
= Mike =
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-04-2003 07:25 AM
тАО06-04-2003 07:25 AM
Re: How to keep special meaning "*" inside a script
If filename generation is active, shell will replace your original line when it is going to be executed:
if test -f /tmp/ffin*
for
if test -f /tmp/ffin02.txt /tmp/ffin09 /tmp/ffin.old
if there are filenames that match the pattern /tmp/ffin*
If not shell will keep the original line:
if test -f /tmp/ffin*
and test will check if /tmp/ffin* file exist (test will not expand the metacharacter *).
Thus, I think that, if file name generation is on, your script would run fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-04-2003 07:53 AM
тАО06-04-2003 07:53 AM
Re: How to keep special meaning "*" inside a script
I wanted to enable file name generation. The problem was that I had the next parameter at the begin of the script:
#! /bin/sh -f
Next time, I'll send you the full script for detailed analysis ;-)
- « Previous
-
- 1
- 2
- Next »