Create file without replacing variables:
1 2 3 4 5 6 |
cat <<'EOF' > /path/file ============================ My name is ${0} I was input via user data ============================ EOF |
If you check /path/file you will see exactly the content above.
Create file REPLACING the variables while creating:
1 2 3 4 5 6 |
cat <<EOF > /path/file ============================ My name is ${0} I was input via user data ============================ EOF |
In this example, the variable ${0} will be replaced during the creation of the file, hence the content will display your username.