I have file called praveen.pl. This script contains many lines, one of which is:$input_store_nbr = 00100;What ever number is inside the nnnnn will be changed by manual testers as per their input.  So, I want to find this line and change this nnnnn per my input.For example if my input is 10000 this line in praveen.pl should change to $input_store_nbr = 10000;Next time if I want to change it to 20000 this line should change to $input_store_nbr = 20000;I am trying to automate this store number edit in praveen.pl file.
find and replace full line in unix script
shell
If you simply must modify this is script, and yet cannot modify it to accept a command line parameter for some strange reason you could try the following:new_val=5000sed -e s/\$input_store_nbr = \[0-9]+\;/\$input_store_nbr = \$new_val\;/ src_file > tmp_filemv tmp_file src_fileor if you have a sed that supports it (like GNU or BSD with an argument) you could use the -i flag to sed and not need the (explicit) temporary file.I still think you'd be better of modifying the source script one time though (since are already modifying it) to do something like:$input_store_nbr = $ARGV[0];then invoking it with the new number as the first command line argument, as you would have passed to the sed script to rewrite the file.