04-13-2014
Edit the file in shell script
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. 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?
2. Relevant commands, code, scripts, algorithms:
Need to edit /etc/sysctl.conf while running script.
3. The attempts at a solution (include all code and scripts):
I have tried it using vi and i am not able to do this.
4. 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).
10 More Discussions You Might Find Interesting
1. AIX
What I want to do is just delete some lines from a text file, I know it's easy using copy and redirect function, but what I have to do is edit this file (delete the lines) directly, as new lines may be added to the text file during this period. Can AIX do this ?
# cat text
1:line1
2:line2... (3 Replies)
Discussion started by: dupeng
3 Replies
2. Shell Programming and Scripting
Hi
I need some help using shell script to edit a file.
My original file has the following format:
/txt/email/myemail.txt
/txt/email/myemail2.txt
/pdf/email/myemail.pdf
/pdf/email/myemail2.pdf
/doc/email/myemail.doc
/doc/email/myemail2.doc
I need to read each line. If the path is... (3 Replies)
Discussion started by: tiger99
3 Replies
3. Shell Programming and Scripting
I need to edit a config file using shell script. i.e., Search with the 'key' string and edit the 'value'.
For eg: below is what I have in the config file "configfile.cfg".
Key1=OldValue1
Key2=OldValue2
I want to search for "Key1" and change "OldValue1" to "NewValue1"
Thanks for your... (7 Replies)
Discussion started by: rajeshomallur
7 Replies
4. Shell Programming and Scripting
Can anyone provide me a shell script to edit a xml file and delete one entry.
To do manually i can edit(vi editor) the file and 'dd' will delete the file.But I wiluld to know if I can do with a script.
Thanks in advance
Tannu (6 Replies)
Discussion started by: tannu
6 Replies
5. Shell Programming and Scripting
I have one csv file and in that I want update particular cell. I know the row and coloumn number for that respective.
Please help me... (6 Replies)
Discussion started by: deepak_p86
6 Replies
6. Shell Programming and Scripting
Hi,
Can some one tell me if we can configure the jobs in crontab using a shell script.
I know it can be done easily by using "crontab -e", but i just want to know whether we can add a job into the crontab using a shell script.
If it can be done, plz suggest the procedure to do it.
If it... (6 Replies)
Discussion started by: rudrarajumk
6 Replies
7. Shell Programming and Scripting
Hello,
I have a big file in wich I would like to rename inside this exactly the string '_ME' and not rename in case we have 'ABC_MELANGE'. Is there a way to do it by using a shell script?
Any tip will be apreciated.
The file is like described bellow, after using command more filename :
... (3 Replies)
Discussion started by: Titas
3 Replies
8. Shell Programming and Scripting
i have a file called number which contains data as
1 2 3 4 5
6 7 8 9 0
9 8 7 6 5
4 3 2 1 0
0 1 2 3 4
needed a shell script to print the output as
1
7
7
1
4
and (2 Replies)
Discussion started by: jacky29
2 Replies
9. Shell Programming and Scripting
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?
Regards
Navaz (1 Reply)
Discussion started by: Abdul Navaz
1 Replies
10. Shell Programming and Scripting
Hello Folks,
I have a file named as date.dat present at /tmp/abc location which has following data -
20161030,20161031,20161101
I need to remove this line and replace it with something like below -
$param1,$param2,$param3
Param1, Param2 and param3 stores the date based on some calculation in... (1 Reply)
Discussion started by: ektubbe
1 Replies
LEARN ABOUT FREEBSD
sysctl.conf
SYSCTL.CONF(5) BSD File Formats Manual SYSCTL.CONF(5)
NAME
sysctl.conf -- kernel state defaults
DESCRIPTION
The /etc/sysctl.conf file is read in when the system goes into multi-user mode to set default settings for the kernel. The /etc/sysctl.conf
is in the format of the sysctl(8) command, i.e.
sysctl_mib=value
Comments are denoted by a ``#'' at the beginning of a line. Comments can also exist at the end of a line, as seen in the EXAMPLES section,
below.
FILES
/etc/sysctl.conf Initial settings for sysctl(8).
EXAMPLES
To turn off logging of programs that exit due to fatal signals you may use a configuration like
# Configure logging.
kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11)
SEE ALSO
rc.conf(5), rc(8), sysctl(8)
HISTORY
The sysctl.conf file appeared in FreeBSD 4.0.
BUGS
If loadable kernel modules are used to introduce additional kernel functionality and sysctls to manage that functionality, sysctl.conf may be
processed too early in the boot process to set those sysctls. For example, sysctls to manage the linux emulator cannot be set in sysctl.conf
if the linux emulator is loaded as a module rather than compiled into the kernel.
BSD
December 30, 1999 BSD