Hi folks,
whenever a certain line within a script becomes too long I'm trying to use \ to separate the specific line ...
e.G.
becomes
So far so good, but quite often it happens, that I need to separate the line somewhere within an echo command and if I do so all the blanks at the beginning of the second line are being printed, completely ruining the output format.
Here's an example:
The output looks something like this:
How can I solve this issue without having to remove the blanks at the beginning of each line between the "then" and "fi" ?
Regards,
Thomas
whenever a certain line within a script becomes too long I'm trying to use \ to separate the specific line ...
e.G.
Code:
if [something -eq something ];
then
cat /123/abc/dljsa/blabla/loooong_directory/1.pdf | grep test | awk '{print $1}' > /123.log
fi
becomes
Code:
if [something -eq something ];
then
cat /123/abc/dljsa/blabla/loooong_directory/1.pdf \
| grep test | awk '{print $1}' > /123.log
fi
So far so good, but quite often it happens, that I need to separate the line somewhere within an echo command and if I do so all the blanks at the beginning of the second line are being printed, completely ruining the output format.
Here's an example:
Code:
if [something -eq something ];
then
echo "Something veeeeeeeeery long it is \
what I want to say here"
fi
The output looks something like this:
Code:
Something veeeeeeeeery long is is what I want to say here
How can I solve this issue without having to remove the blanks at the beginning of each line between the "then" and "fi" ?
Regards,
Thomas