- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- linux wildcard
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
07-03-2005 09:46 PM
07-03-2005 09:46 PM
linux wildcard
I am attempting to write a script on Linux RH(9) Shrike that will fetch all files in the format `DEL<6_unique_digits>K` from a remote server.
My script works fine apart from fetching the actual filetypes that I need. For example I have tried all of the following combinations without any luck.....
FILESPEC=DEL*K
FILESPEC=^DEL\d\d\d\d\d\d\K
FILESPEC=`[^DEL]^[K]
........as you can I see I am running out of ideas for this, can anybody help?
Dermot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2005 10:21 PM
07-03-2005 10:21 PM
Re: linux wildcard
DEL*K
DEL??????K
DEL[0-9][0-9][0-9][0-9][0-9][0-9]K
Obviously, the first will not restrict the interviening characters to 6.
The second will restrict it to 6 middle characters, but not what those characters are.
The third restricts the middle 6 characters to digits.
Now, you have to be careful where you use these however, as if you don't quote at the right time, they'll be expanded then, and not later when you want it to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2005 10:40 PM
07-03-2005 10:40 PM
Re: linux wildcard
opendir DIR, "/root/perl";
for $_(readdir DIR)
{
print $_."\n" if /^DEL\d{6}K$/;
}
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2005 10:40 PM
07-03-2005 10:40 PM
Re: linux wildcard
opendir DIR, ".";
for $_(readdir DIR)
{
print $_."\n" if /^DEL\d{6}K$/;
}
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2005 11:19 PM
07-03-2005 11:19 PM
Re: linux wildcard
D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 03:25 AM
07-04-2005 03:25 AM
Re: linux wildcard
you can try this
FILESPEC=DEL[0,9]{1,6}K
which will match the files containing the string "DEL<1 to 6 digits>K" anywhere in the file.
As you can see it with match both DEL1K and DEL123456K. so if you want it to be specific about the number of digits, use this:
FILESPEC=DEL[0-9]{6,6}K
Hope this helps,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 03:45 AM
07-04-2005 03:45 AM
Re: linux wildcard
ncftpget: server said: Specified object name too long, limit is 10 characters: DEL[0-9]{6,6.
+ ERRCODE=3
Apologies about this but I have just discovered that the remote server I am trying to grab these files from is a OS/400. Does this help?
D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 03:59 AM
07-04-2005 03:59 AM
Re: linux wildcard
oops, are you using this on OS 400? I am sorry, this pattern matching will work on newer versio n of bash shell in linux and I really doubt whether the shell available in OS 400 does really support pattern matching at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2005 11:23 AM
07-04-2005 11:23 AM
Re: linux wildcard
{} braces in most bourne-based shells (including ksh & bash) is treated as multiple-parts, i.e. file{1,2} = file1 file1.
Not even bash 3.00.16 (part of FC4) has reguler-expression globbing.