Oke so i want to make a script that automaticaly install some apps adds some lines to some files replace some lines from files
For the install i use apt-get -y install packagename
For adding line im using :
sudo sh -c 'echo "#Name" >> /etc/apt/sources.list'
sudo sh -c 'echo "deb http://addres onceric main" >> /etc/apt/sources.list'
Is this correct?? is there a better way???From what i read about this problem it adds at the bottom of the file correct??
I want to remove somthing from a file eg. #deb http:// i want to remove the # from this line how can i do this?
I want to replace some lines in some files eg. program.desktop;program2.desktop
how can i do this???
i tried
wfind="program1.desktop;program2.desktop;program.2.desktop;programxxxx.desktop;"
wreplace="program2.desktop;otherprogram.desktop;moretext;ect;"
sed 's/$wfind/$wreplace/g' ~/file.txt > ~/file.txt
But i got an error that command s is not recognize or somthing like that??