Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 25 Nov 2014, 18:09
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Odd Bash script inconsistancy...
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 2 of 2 Posts_count   Goto page: Previous 1, 2
Author Message
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Mon 25 Jan 2010, 18:09    Post_subject:  

sunburnt wrote:

It gives the first file... Not the wildcard argument.!!!
It seems that the wildcard is being interpreted by being the "$1" argument!
So feeding wildcards to a script just doesn`t work! Period!


Well isn't that curious!

Code:
./script "t*"
WORKS

so you would think that if you build a wildcard parameter with single quotes around it - like this -

Code:
# w='"t*"'
# echo $w
"t*"
#
would do the trick - but no -

Code:
./script $w or "$w"
FAILS
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2278

PostPosted: Tue 26 Jan 2010, 06:58    Post_subject:  

Enclosing in single quotes turns off expansion of wildcards -i mean the outer quotes. This: "'$var'" would still get expanded. Sometimes you have to escape characters to keep them from being immediately expanded by the shell: \$var
Back to top
View user's profile Send_private_message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Tue 26 Jan 2010, 12:32    Post_subject:  

Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 2 of 2 Posts_count   Goto page: Previous 1, 2
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0565s ][ Queries: 12 (0.0148s) ][ GZIP on ]