mardi 6 janvier 2015

Appending text read from a file on the top of another file


I want to add "void mainfunction()" on the top of a file. I am reading the actual name of the file from another file and the name of the main function from another file. I was using "sed -i '1i void $name_main()' $name_c" where the name of the file is stored in name_c and the name_main stores the name of the main function. But this command is appending void $main_name() on the top of the file. How can I do this?



Aucun commentaire:

Enregistrer un commentaire