in reply to creating Shell Script using Perl
G'day pratikmonu,
Consider using a here-document for that. You should find the code is a lot cleaner and you'll only need a single print statement.
Here's a rough example based on the code you posted:
#!/usr/bin/env perl use strict; use warnings; my ($file, $string) = qw{$HOME/... Completed...}; print <<"EOF"; #!/bin/sh FILE="$file" STRING="$string" while ... "$file" ... "$string" ... EOF
Output:
#!/bin/sh FILE="$HOME/..." STRING="Completed..." while ... "$HOME/..." ... "Completed..." ...
— Ken
|
|---|