Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read

Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 24-Aug-2008, 10:56
DrEaMeR23's Avatar
Student Penguin
 
Join Date: Aug 2008
Posts: 84
DrEaMeR23 hasn't been rated much yet
Default Wildcards

What are the bash wildcards? (e.g *,?...)
Reply With Quote
  #2 (permalink)  
Old 24-Aug-2008, 12:05
Puzzled Penguin
 
Join Date: Jun 2008
Posts: 22
giaslamo hasn't been rated much yet
Default Re: Wildcards

Using bash wildcards

I bookmark for future reference, because my memory is like 64k.
Reply With Quote
  #3 (permalink)  
Old 24-Aug-2008, 18:25
ab@novell.com
Guest
 
Posts: n/a
Default Re: Wildcards

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That's fair... it's all the memory you'll ever need.... or so he says.

Good luck.





giaslamo wrote:
> 'Using bash wildcards'
> (http://www.shell-tips.com/2006/11/04...ash-wildcards/)
>
> I bookmark for future reference, because my memory is like 64k.
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIse3N3s42bA80+9kRAto5AJ96tLtV5mj4N+JI2dysY1 XheiRA/gCfVDYe
VFQMw6rvymUNa2vttHP4OKQ=
=9FBQ
-----END PGP SIGNATURE-----
Reply With Quote
  #4 (permalink)  
Old 25-Aug-2008, 11:04
Puzzled Penguin
 
Join Date: Aug 2008
Posts: 32
Solar_Granulation hasn't been rated much yet
Default Re: Wildcards

There are quite a few options for wildcards in Bash. I'm not sure how comprehensive this list is, but it's at least a starting point:

* (asterisk) zero or more characters

? (question mark) one character

[abcde] - any one of the character from the contents of square brackets

[a-e] - any one character in the range defined either side of the dash within square brackets

[!abcde] or [!a-e] modifies the two previous examples with "not"

{suse,linux} any one string from the options listed in curly brackets
Reply With Quote
  #5 (permalink)  
Old 25-Aug-2008, 17:35
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 6,088
ken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputationken_yap has a brilliant future with this reputation
Default Re: Wildcards

Strictly speaking that last one {suse,linux} isn't a wildcard but brace expansion. What is the difference? Brace expansion works even if there is no match. Say you have file1 and file3 in a directory.

echo file[1-3]

will get you file1 file3, but

echo file{1,2,3}

will get you file1 file2 file3

You can read all about brace expansion in the man page.
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.2