I would like to achieve this procedure.
I have this command:
sed -i -e 's/few/asd/g' /usr/local/sbin/.myappenv
This command works if in the file .myappenv
there is a few
string text. But this command fails to simply create the asd
text wheter or not the few
is found.
So, if there is the few
text, it should replace it, if few
text is missing, just create it on the first line.
EDIT_:
It should create the string on the first line of the document .myappenv
, it should only be created if there is no coincidence.
The file .myappenv
should contain =>
asd
If the file is already populated with few
just replace it =>
asd