bash

script, ${somestring} . , , - , , .

?

:

# \$\{somestring\} works, but leaves the \ which I don't want.
myvar=("Yes I require multiple lines.
    Test \${somestring} test"); 

echo "$myvar" >> "mytest.conf";

      

+3




1


, ${}

:

$ myvar=5
$ echo 'this is ${myvar}'
this is ${myvar}
$ echo "this is ${myvar}"
this is 5

      




, , ( , Bash):

$ myvar=("Yes I require multiple lines.
  test \${somestring} test");
$ echo "$myvar" > a
$ cat a
Yes I require multiple lines.
  test ${somestring} test

      

+9









All Articles