So i'm trying to create a script1, this script has script2 data inside itself. what i'm trying is:
echo "echo"Hello"">>script2
it should show
(echo "Hello") inside script2 instead it is showing (echo Hello)
Please suggest what should i do to achieve it. Thanks.
CodePudding user response:
You can escape the quote characters with \
:
echo "echo\"Hello\"">>script2
Alternatively, use single quotes to ignore special characters inside the string:
echo 'echo"Hello"'>>script2