Shell script, what does this line do: "cat -- << EOF >${CreateScript_DeployDirs}"
Hello,
I'm analyzing a script from someone else and I'm asking what does this line do? In short I have made a test script, trying to understand how it works..., but it is not clear to me: Code:
set -euo pipefail But this is the result: Quote:
I hope that someone can explain how this work and why and/or when such a construction should be used. Nico. |
cat will write the text between EOFs into the named file. If that was possible (=writing that file).
|
This does not do anything, there is nothing to cat.
Code:
cat -- << EOF > ${CreateScript_DeployDirs} Code:
a=1 |
That's a little bit of a mess. Is this what you are trying to do?
Code:
cat -- << EOF > test.txt Code:
LocalPath="/home" |
Hello,
Now I see it what this part is doing: Code:
cat -- << EOF >${CreateScript_DeployDirs} But I was not aware what that this was possible to write in a file with cat -- << EOF >${variable}...EOF. Very powerfull from my point of view. Thanks. Nico |
All times are GMT -5. The time now is 05:17 PM. |