4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 LXF#126 Shell scripting explanation
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
jasminemark
Junior WebHelper
Junior WebHelper


Joined: 01 Apr 2011
Posts: 4

PostPosted: Fri Apr 01, 2011 7:12 am (6 years, 6 months ago) Reply with QuoteBack to Top

Trying to follow the script Bob Moss has on pg 48-51. Just a beginner so please have patience. When I get to point
var=$1
echo $var

and then type

sh script_tutorial.sh ''Hello,World\!''

I must assume that the quotes here are two single quotes at the beginning of the Hello,World string and at the end of the line. If I try double quotes here I get

Hello,World\!

and on the next step, sending the value of the argument ($1) to the file sample.txt results in a blank file.
It does work with two single quotes, though. Is this correct? Why is it necessary to escape the ! question mark

________________________________
Funny Cricket Image
OfflineView User's ProfileFind all posts by jasminemarkSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.046034 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme