echo using single quotes | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

echo using single quotes

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-26-2007
chella chella is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 30 March 2009, 6:42 AM EDT
Posts: 75
Thanks: 0
Thanked 2 Times in 2 Posts
echo using single quotes

Hi,

Please help me to echo the following statement using single quotes

Why can't I write 's between single quotes

Thanks in advance,
Chella
Sponsored Links
    #2  
Old 10-26-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 28 November 2014, 8:27 PM EST
Location: NM
Posts: 10,285
Thanks: 288
Thanked 816 Times in 758 Posts

Code:
echo "Why can't I write 's between single quotes"

Sponsored Links
    #3  
Old 10-26-2007
earnstaf earnstaf is offline
Registered User
 
Join Date: May 2007
Last Activity: 15 November 2012, 10:53 PM EST
Posts: 113
Thanks: 0
Thanked 0 Times in 0 Posts
If I understand your problem, you are trying to do:

Code:
echo 'why doesn't this work?'

You'll need to escape the inner ' so it is seen literally.


Code:
echo 'shouldn\'t this work fine?'

    #4  
Old 10-29-2007
chella chella is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 30 March 2009, 6:42 AM EDT
Posts: 75
Thanks: 0
Thanked 2 Times in 2 Posts
Thank You for the reply.

But still I am not able to get the required output.

echo 'shouldn\'t this work fine?'

when I tried the above statement it asks to use another single quote at the end.

Please help me.

Regards,
Chella
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Having a terrible problem with quotes/single quotes! jondecker76 Shell Programming and Scripting 2 07-27-2011 05:22 AM
Replace single quote with two single quotes in perl DushyantG Shell Programming and Scripting 3 04-07-2011 03:16 AM
grep single quotes or double quotes george_vandelet UNIX for Dummies Questions & Answers 2 10-27-2010 12:23 PM
problem with echo inserting single quotes jelloir Shell Programming and Scripting 7 09-12-2010 05:40 AM
Single quotes and double quotes sol_nov Shell Programming and Scripting 5 09-16-2009 10:44 PM



All times are GMT -4. The time now is 05:43 AM.