View unanswered posts | View active topics It is currently 23 May 2019 4:45 pm



Post new topic Reply to topic  [ 1 post ] 
LXF#126 Shell scripting explanation 
Author Message

Joined: 01 Apr 2011 2:29 pm
Posts: 4
Post LXF#126 Shell scripting explanation
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

_________________
Cheap Website Design


01 Apr 2011 2:44 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
cron

Party Dresses
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Forum style by Vjacheslav Trushkin for Free Forums/DivisionCore.