我正在尝试使用 sed 和正则表达式将字符串添加到行尾。
我有以下字符串:
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
我试图在它的末尾添加字符串:
exec,system,shell_exec,passthru,
我的尝试如下:
sed -ie 's/disable_functions = .*[a-zA-z,]$/disable_functions = $1exec,system,shell_exec,passthru,/gI' /etc/php5/apache2/php.ini
似乎只是将 $1 添加到字符串 disable_functions = $1exec,system,shell_exec,passthru,
我哪里错了?