Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have this record of a csv:

"0258327469@pippo.it","456281438","16274","782981244047720"," ","<table cellpadding=""0"" cellspacing=""0"" border=""0"" width=""100%"" align=""center"" style=""font-size:0;""><tr>","","","","",""

I need to fill a file until I reach a specified size of the file. I would use a simple loop putting in append the same row. Is there a way with echo to just write this line including every " encountered?

If I use echo -e I got

eianni@ianni-desktop:~/Desktop$ echo -e "0258327469@pippo.it","456281438","16274","782981244047720"," ","<table cellpadding=""0"" cellspacing=""0"" border=""0"" width=""100%"" align=""center"" style=""font-size:0;""><tr>","","","","",""
0258327469@pippo.it,456281438,16274,782981244047720, ,<table cellpadding=0 cellspacing=0 border=0 width=100% align=center style=font-size:0;><tr>,,,,,
share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can prevent bash from processing the quotes by wrapping the whole argument to echo in single-quotes.
echo -e '"0258327... .."",""' should do the trick.

share|improve this answer
    
lika a charm, thanks –  dierre Apr 2 '12 at 16:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.