Thank you very much for explaining. I will try what Sandy suggested.
I had tested at the command line already just as Jeff did. The
confusion came from the fact that I had tried it in csh and in csh,
doing the "ls |xargs cat" returned 1. Annoying.
C.
--
To unsubscribe, e-mail: [EMAIL PROTEC
On 27 мар, 03:50, [EMAIL PROTECTED] (Ultra Star X) wrote:
> I am really going crazy here. I have the following system call that I
> would like to run from perl:
> "ls *.txt | xargs cat > out"
> if *.txt does not exist then I expect to get an exit code different
> from 0.
>
> So to test I do:
>
>
This is because you send ls's output to a pipe, and the command on the
right of the pipe get executed successfully.
Try this test on shell:
-bash-3.00$ ls |xargs cat
ls: : No such file or directory
-bash-3.00$ echo $?
0
-bash-3.00$ ls
ls: : No such file or directory
-bash-3.00$ ec
On Wed, 24 Oct 2001, Daniel Falkenberg wrote:
> I am working on a CGI script that needs to execute this command from a
> sub within the script...
>
> system("/usr/sbin/adduser test");
>
> I can issue this from a single non-CGI script and it works fine. I have
> also double checked the permission
>
>
>I did this in one of my programs and it seemed to work just fine:
>
>system("$command &");
>
Check it out again.
contents of child.pl:
#!/usr/bin/perl
sleep 10;
print "child exiting\n";
contents of parent.pl
#!/usr/bin/perl
system( "perl child.pl &" );
print "parent exiting\n";
You will
: Jonathan Howe; [EMAIL PROTECTED]
Subject: RE: system calls
I did this in one of my programs and it seemed to work just fine:
system("$command &");
Which, I believe, runs your command in the background and lets you return to
your program. (Please correct me if I am wrong). This wil
I did this in one of my programs and it seemed to work just fine:
system("$command &");
Which, I believe, runs your command in the background and lets you return to
your program. (Please correct me if I am wrong). This will only work on
*nix systems.
Sid.
-Original Message-
From: Jona
On Sep 21, Jonathan Howe said:
>Is it possible when making a call to the system, using the system
>command our back ticks to have a script exit/finish with out hanging
>around for a return from the process handed to the system.
You need to fork a new process.
if ($pid = fork) {
print "chi
depending on what you want, you could use the Win32::* modules (standard
with active state perl, else get them from cpan)
or use a system call if they dont do what you want...
if you have a more precise question, feel free to ask, but i'm nto sure what
extra advice to give you now =)
regards,
J
>
> sorry about the terse code snippet
no problem, it is good code :-)
>
> Basically, I have an SSH tunnel that is controlled by another
> process and I want to tell when that ssh tunnel is closed.
Have you or R U looking into or using IO::Socket::SSL ??
There might be a method in there
part:
1) Id like to know if theres a better way to do this
2) Is it really horribly expensive to do this with sys calls?
-Original Message-
From: Kipp, James [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 29, 2001 9:52 AM
To: 'Matt Weatherford'; [EMAIL PROTECTED]
Subject:
Hi Matt
Can you describe a little bit what U are trying to do or include more of
the code. Depending on what U are trying to do, there may be less expensive
alternatives
Thanks
Jim
>
>
>
>
> From PERL, I have been doing some system calls like this:
> (see * lines)
>
>
> * my $procentry=`
12 matches
Mail list logo