Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: creating Shell Script using Perl

by manoj_speed (Prior)
on Oct 10, 2017 at 11:37 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1201098]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-24 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found