General TC > General TC Talk
[SOLVED] echo command is not quite working the way I prefer
tinypoodle:
Oh, ok, gotcha, had thought that it was copy of script.
aus9:
althalus
I test.....eg input text = (in a code box to show space)
--- Code: ---title: line 1
line 2
EOF
--- End code ---
then do a command based on your method (copy and paste from terminal input and results)
--- Code: ---cat > /tmp/test << EOF
> title: line 1
> line 2
> EOF
cat /tmp/test
title: line 1
line 2
--- End code ---
Input is truncating space.
gerald_clark
You are right, but my time is limited by my learning skills, good looks or thereof and time issues
aus9:
edit now irrelevant
althalus:
--- Quote from: aus9 on April 21, 2013, 11:06:34 PM ---Input is truncating space.
--- End quote ---
If you pasted in those extra lines, the truncating happens in the paste. Same thing happens if you use echo "" and paste multiple lines.
--- Quote from: aus9 on April 21, 2013, 11:10:16 PM ---also I gather, if I had no internal 'string' or "string" my original method might just work?
--- End quote ---
Yes, but that's obviously going to be problematic for cases like the init script in your initial post.
aus9:
thanks everyone so far.
I can get around it, with my current skills
I use the echo ' string with spaces' > /pathway/file
then if I encounter " or ' internally, I do one line at time with an append
echo ' blah "string" blah ' >> /samefile
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version