Rajesh Dorairajan wrote:
>
> Hello All,
Hello,
> I am using Perl to launch installer written in Shell script on Solaris. I am
> supplying the arguments for all the prompts made by the installer from Perl,
> such as path, port number etc., The installer displays a copyright page that
> has multiple pages when it is launched and then prompts the user to accept
> or decline the license agreement. I am trying to modify the script such that
> all the pages are displayed at once instead of displaying one page at a
> time. The shell command in the script is:
>
> "cat copyright | more"
>
> I am trying to edit the script and modify it as:
>
> "cat copyright"
>
> I am trying the following command from perl:
>
> system("perl -p -i.bak -e \"s/cat copyright | more/cat copyright/\" install.sh");
The vertical bar character (|) is special in a regular expression. Your
regex is searching for the string 'cat copyright ' OR the string '
more'. You have to escape \| if you want to match a literal |
character. There is no reason to run system() to do something you can
do directly in perl.
{ local ( $^I, @ARGV ) = ( '.bak', 'install.sh' );
while ( <> ) {
s/cat copyright \| more/cat copyright/;
print;
}
}
> However, when I run this command from Perl, It reports that I am not owner
> of the file (install.sh) and when I do a "ls" from the shell, the install.sh
> file has disappeared!!!!
Is the 'install.sh.bak' file there?
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>