Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: creating Shell Script using Perl

by manoj_speed (Prior)
on Oct 10, 2017 at 11:37 UTC ( #1201098=note: print w/replies, xml ) Need Help??


in reply to creating Shell Script using Perl

Please try the below code.
sub create_db_install_val(){ $File_name="DB_INSTALL_VALIDATION.sh"; print "\n Shell name to validate DB Installation Completion is $File +_name\n"; $MYSCRIPT=<<SCRIPT; #!/bin/sh FILE="/scratch/pratranj/DB_11.2.0.1.0/config/setup.log" STRING="Completed creating database instance" EXIT=1 while : ;do [[ -f "\$FILE" ]] && grep -q "\$STRING" "\$FILE" && echo "DB Install +ation is completed" && break sleep 5 done SCRIPT open (FILE,">$File_name") or die "cannot open $File_name file"; print FILE $MYSCRIPT; close(FILE); } Output: ------- $ cat DB_INSTALL_VALIDATION.sh #!/bin/sh FILE="/scratch/pratranj/DB_11.2.0.1.0/config/setup.log" STRING="Completed creating database instance" EXIT=1 while : ;do [[ -f "$FILE" ]] && grep -q "$STRING" "$FILE" && echo "DB Installati +on is completed" && break sleep 5 done
-- The wisest mind has something yet to learn.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1201098]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2020-05-31 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (177 votes). Check out past polls.

    Notices?