Timeline for Write variable containing large text with \n to a file with common shell interpreters. How do you do it?
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 5, 2014 at 10:52 | history | edited | Pier A | CC BY-SA 3.0 |
added 145 characters in body
|
| Aug 5, 2014 at 8:39 | history | edited | Pier A | CC BY-SA 3.0 |
added 314 characters in body
|
| Aug 5, 2014 at 8:34 | comment | added | Pier A |
That is true, but, that is due my crap English sorry, it is like that you get $a, you want to print it to a file but you cannot change it. You receive this variable and your goal is printing it out. So your solution is ok but it is referring to another problem.
|
|
| Aug 5, 2014 at 6:45 | comment | added | mikeserv |
@PierfrancescoPierQRAiello - I don't think you do need to store it in $a at all. Consider: for i in 1 2 3 4 5 ; do echo "$i" ; done >file. But doing for i in $(seq $num) ; do echo word $i; done is redundant because you can just do seq -s'word' $num
|
|
| Aug 5, 2014 at 6:33 | comment | added | Pier A | And yes I get $a in the format defined by the for and I need to output it. | |
| Aug 5, 2014 at 6:21 | comment | added | Pier A | I didn't know either, just try it. In the end is reasonable, everything is finite. | |
| Aug 4, 2014 at 21:57 | answer | added | mikeserv | timeline score: 1 | |
| Aug 4, 2014 at 21:17 | answer | added | Michael Homer | timeline score: 5 | |
| Aug 4, 2014 at 20:43 | comment | added | Stéphane Chazelas |
How is echo failing. echo is usually built-in and should not trigger the E2BIG error.
|
|
| Aug 4, 2014 at 17:35 | history | edited | Pier A | CC BY-SA 3.0 |
added 20 characters in body
|
| Aug 4, 2014 at 17:05 | review | First posts | |||
| Aug 4, 2014 at 17:11 | |||||
| Aug 4, 2014 at 17:01 | comment | added | ryekayo | Are you requesting to pass the results of $a (the echo statement) into a text file? | |
| Aug 4, 2014 at 16:59 | history | asked | Pier A | CC BY-SA 3.0 |