Changeset 10984
- Timestamp:
- 2005-12-09T11:35:10+13:00 (18 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/pluginfo.pl
r10825 r10984 194 194 } 195 195 196 197 # this causes us to automatically send output to a pager, if one is198 # set, AND our output is going to a terminal199 # active state perl on windows doesn't do open(handle, "-|");200 if ($ENV{'GSDLOS'} !~ /windows/ && -t STDOUT) {201 my $pager = $ENV{"PAGER"};202 if (! $pager) {$pager="(less || more)"}203 my $pid = open(STDIN, "-|"); # this does a fork... see man perlipc(1)204 if (!defined $pid) {205 gsprintf(STDERR, "pluginfo.pl - can't fork: $!");206 } else {207 if ($pid != 0) { # parent (ie forking) process. child gets 0208 exec ($pager);209 }210 }211 open(STDERR,">&STDOUT"); # so it's easier to pipe output212 }213 214 215 196 &main (); -
trunk/gsdl/perllib/printusage.pm
r10324 r10984 177 177 my $programdesc = shift(@_); 178 178 179 # this causes us to automatically send output to a pager, if one is 180 # set, AND our output is going to a terminal 181 # active state perl on windows doesn't do open(handle, "-|"); 182 if ($ENV{'GSDLOS'} !~ /windows/ && -t STDOUT) { 183 my $pager = $ENV{"PAGER"}; 184 if (! $pager) {$pager="(less || more)"} 185 my $pid = open(STDIN, "-|"); # this does a fork... see man perlipc(1) 186 if (!defined $pid) { 187 gsprintf(STDERR, "pluginfo.pl - can't fork: $!"); 188 } else { 189 if ($pid != 0) { # parent (ie forking) process. child gets 0 190 exec ($pager); 191 } 192 } 193 open(STDERR,">&STDOUT"); # so it's easier to pipe output 194 } 195 196 197 179 198 my $programname = $options->{'name'}; 180 199 my $programargs = $options->{'args'};
Note:
See TracChangeset
for help on using the changeset viewer.