![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to change the replace the String in sub folders | bobbygsk | UNIX for Dummies Questions & Answers | 6 | 09-30-2008 01:09 PM |
| change string in file | kamel.seg | Shell Programming and Scripting | 1 | 01-07-2008 07:45 AM |
| How to change only the x first characters of a string? | Juha | Shell Programming and Scripting | 2 | 09-28-2007 09:17 AM |
| replace character in a string pattern and save the change in same file | mihir0011 | Shell Programming and Scripting | 2 | 09-26-2007 06:31 PM |
| Change the a string in the file | kamathg | Shell Programming and Scripting | 3 | 08-08-2007 09:14 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
try this shell script: Code:
#!/bin/bash
grep '^skip-slave-start' my.cnf >& /dev/null
if [ $? -ne 0 ] ; then
echo "skip-slave-start is not turned on, so going to turn it on..."
grep '^ *# *skip-slave-start' my.cnf >& /dev/null
if [ $? -eq 0 ] ; then
# skip-slave-start is commented
sed -i 's/^ *# *skip-slave-start/skip-slave-start/' my.cnf
# so uncommnt it
else
# skip-slave-start is not present
sed -i 's/\[mysqld\]/[mysqld]\nskip-level-start/' my.cnf
# so add it in [mysqld] section
fi
else
echo "skip-slave-start was turned on"
fi
|
![]() |
| Bookmarks |
| Tags |
| bash, mysql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|