Hi, I am trying to create a shell script to be executed inside a perl code, Problem:- The Script gets created, but the Variable value is not set.
sub create_db_install_val(){ $File_name="$HOME/DB_INSTALL_VALIDATION.sh"; print "\n Shell name to validate DB Installation Completion is $File_n +ame\n"; open (FILE,">$File_name") or die "cannot open $File_name file"; print FILE "#!/bin/sh\n"; print FILE "FILE=\"/scratch/pratranj/DB_11.2.0.1.0/config/setup.log\"\ +n"; print FILE "STRING=\"Completed creating database instance\"\n"; print FILE "EXIT=1\n"; print FILE "while : ;do\n"; print FILE " [[ -f \"$FILE\" ]] && grep -q \"$STRING\" \"$FILE\" && + echo \"DB Installation is completed\" && break\n"; print FILE "sleep 5\n"; print FILE "done\n"; close(FILE); }
When I execute this perl fucntion, it writes shell script where the $FILE value is not set, something Like this:-
#!/bin/sh FILE="/scratch/pratranj/DB_11.2.0.1.0/config/setup.log" STRING="Completed creating database instance" EXIT=1 while : ;do [[ -f '""' ]] && grep -q "" "" && echo "DB Installation is complet +ed" && break sleep 5 done
Please suggest how to get the value of $FILE and $STRING in the shell file created within perl
Thanks, PR
In reply to creating Shell Script using Perl by pratikmonu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |