learning-perl6/ch4/ex4-7.raku

11 lines
299 B
Raku
Raw Permalink Normal View History

2023-11-23 16:26:32 +00:00
sub MAIN () {
# Unset PATH for shell safety (pg. 68)
%*ENV<PATH> = '';
print Q :x 'C:\Windows\System32\hostname.exe' if $*DISTRO.is-win;
print Q :x '/bin/hostname' unless $*DISTRO.is-win;
#avoid variable inputs for shell scripts
#qqx/date $my-new-date/
#my $my-new-date = '; /bin/rm -rf';
}