Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
The problem statement, all variables and given/known data:
I am trying to automate hadoop installation procedure using shell script. It involves go to perticular directory and add some more lines to the file /etc/sysctl.conf. How this can be done?
Relevant commands, code, scripts, algorithms:
Need to edit /etc/sysctl.conf while running script.
The attempts at a solution (include all code and scripts):
I have tried it using vi and i am not able to do this.
Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
University of Houston , Texas, USA, Dr. Deniz Gurkan,ELET6300
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
The vi utility is an interactive editor, not a scripting editor. Look at the man pages for ex , ed , and sed for utilities that are intended to be used to edit files in scripts.
Another thing to consider in your script (maybe some extra credit ): Does it create a way to undo the change you are making to sysctl.conf? Consider taking a backup first...