kettle has asked for the wisdom of the Perl Monks concerning the following question:
$ pwd >! tmp_1
does nothing (in either of the two variations). Eliminating the bang(!) from the redirect, of course, accomplishes the desired effect, but I'm interested in knowing what's behind the apparent inconsistency.#!/usr/bin/perl -w use strict; use warnings; my ($util,$command,$redirect,$file); $util = "pwd"; $redirect = ">!"; $file = "tmp_1"; $command = sprintf("%s %s %s", $util, $redirect, $file); system($command); system("pwd >! tmp_1");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using the bang(!) in perl system commands
by ikegami (Patriarch) on Jun 06, 2006 at 05:02 UTC | |
by kettle (Beadle) on Jun 06, 2006 at 08:38 UTC | |
by derby (Abbot) on Jun 06, 2006 at 13:23 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |