Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-21-2010, 06:33 AM   #1
Registered: Dec 2010
Distribution: ubuntu 10.04
Posts: 43

Rep: Reputation: 0
why ? an easy question,but you know ,i am completely new.......

wang@wang-laptop:~$ echo \"{These,words,are,quoted}\"
"These" "words" "are" "quoted"
wang@wang-laptop:~$ echo "{These,words,are,quoted}"
i am pretty confused,the '\' just quote the '"',so why doe it present as:
"These" "words" "are" "quoted"
instead of :
"{These,words,are,quoted}" ?
Old 12-21-2010, 08:29 AM   #2
Senior Member
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780
It has to do with the brace expansion of the contents within the braces in combination with your escaping (\) the quotes.

This link should help clarify things for you.
Old 12-21-2010, 10:19 AM   #3
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,079

Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
You escaped the quotes, so they are not interpreted by the shell, and they become normal (and printable) characters, just like 'A' or '1'.

The rest is just the way that brace expansion works. You can read about it in the bash man page (or whatever your shell is).


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy C++ question ManuPeng Programming 2 04-05-2007 07:02 PM
Easy question for ya... speedo Linux - Newbie 2 10-23-2004 05:38 PM
easy question ashley75 Linux - General 7 10-15-2003 03:51 PM
easy question Scruff Mandriva 3 08-28-2003 08:34 PM
Completely unrelated question: HTML->Tables->Columns Ctawp Linux - Software 6 08-07-2003 01:31 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration