This shows you the differences between two versions of the page.
update_next_line_based_on_list_of_variable [2009/06/04 04:15] k2patel created |
update_next_line_based_on_list_of_variable [2020/08/10 02:35] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Manipulate File based on list ====== | ||
- | <code bash> | ||
- | #!/bin/bash | ||
- | File_line = list | ||
- | Edit_file = httpd.conf | ||
- | |||
- | for i in $File_line; do | ||
- | |||
- | sed "s#DocumentRoot $i#DocumentRoot $i \\ | ||
- | php_admin_value open_basedir \"$i:/tmp\"#" $Edit_file | ||
- | |||
- | #sed -i.bak "s#DocumentRoot $i#DocumentRoot $i \\ | ||
- | #php_admin_value disable_functions \"exec,system,passthru,readfile,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,p | ||
- | open,parse_ini_file,show_source\"#" httpd.conf | ||
- | |||
- | |||
- | done | ||
- | </code> |