LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-21-2010, 05:33 AM   #1
wang
Member
 
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}"
{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}" ?
thanks.
 
Old 12-21-2010, 07:29 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
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, 09:19 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
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).
 
  


Reply


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 06:02 PM
Easy question for ya... speedo Linux - Newbie 2 10-23-2004 04:38 PM
easy question ashley75 Linux - General 7 10-15-2003 02:51 PM
easy question Scruff Mandriva 3 08-28-2003 07:34 PM
Completely unrelated question: HTML->Tables->Columns Ctawp Linux - Software 6 08-07-2003 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:15 AM.

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