Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / Psh / Strategy / Bang.pm
CommitLineData
86530b38
AT
1package Psh::Strategy::Bang;
2
3require Psh::Strategy;
4
5
6=item * C<bang>
7
8If the input line starts with ! all remaining input will be
9sent unchanged to /bin/sh
10
11=cut
12
13
14@Psh::Strategy::Bang::ISA=('Psh::Strategy');
15
16sub consumes {
17 return Psh::Strategy::CONSUME_LINE;
18}
19
20sub runs_before {
21 return qw(brace);
22}
23
24sub applies {
25 return 'pass to sh' if substr(${$_[1]},0,1) eq '!';
26}
27
28sub execute {
29 my $command= substr(${$_[1]},1);
30
31 my $fgflag = 1;
32 if ($command =~ /^(.*)\&\s*$/) {
33 $command= $1;
34 $fgflag=0;
35 }
36
37 Psh::OS::fork_process( $command, $fgflag, $command, 1);
38 return (1,undef);
39}
40
411;