I have some input let say “somespacehere .file somemorespace “sample.cpp””.
The above line I want to write in a file using shell script.
How should I write a shell script?
Please help me.
Thanks.
I write a code as
#!/bin/bash
filename= "./xyz.txt"
file = open(filename,'w')
echo " .file \"sample.cpp\"" > file
file .close()
It is giving me the error as
Syntax error: “(” unexpected
at last line.
start with a shebang and an echo the line you want to a file? For example,