How write a literal bash command in a bash file?
Hi,
I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it. Here's my bash file: Code:
#!/bin/bash Code:
#!/usr/bin/env bash What i want is a file with the following: Code:
#!/usr/bin/env bash thanks, PSC |
To make a here document fully literal, put quotes around the starting string.
Code:
cat > ~/generateGridmix2data.sh << 'END' Also, $(..) is recommended over `..` |
And if I want to really put a value of a variable and a literal command in a Here Documents block? (Please notice that 'END' is between ' '.)
For example: Code:
#!/bin/bash |
Quote:
Code:
( |
At this stage I'd start looking into m4 ;}
Cheers, Tink |
Maybe I've missed something, but is the following output what you want?:
Code:
root@reactor: cat generateGridmix2data.sh Code:
#!/bin/bash |
Thanks Celine.
That's what I wanted. |
All times are GMT -5. The time now is 10:11 AM. |