Hello Monks, I can't get my script to add another if statement after $1. This is the file I want to modify: #!/sbin/sh # Run rctladm to configure system resource controls based on the settings # previously saved by rctladm. See rctladm(1m) for instructions on how to # modify resource control settings. # if [ -f /etc/rctladm.conf ] && [ -x /usr/sbin/rctladm ]; then /usr/sbin/rctladm -u fi I want to add another if statement after the last if/fi. Thanks, #### #!/usr/bin/perl -w use strict; open SYS, "sysetup"; open OUT, '>', "/tmp/sysout"; my $here=</dev/null 2>&1; then echo "$0: ltps is already running" exit 0 fi HERE while(){ s/^(if.*rctladm.conf.*?fi)/$1\n$here/m; print OUT; }