06-30-2011
You can, if you wrap it in a system() call. like system("grep ...");
And its return value isn't boolean. It will return zero on success and some nonzero number on failure. So check for zero.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a build script. It was created on Linux. For some reason, I got it to windows and modified it. And brought it back again to Linux.
Since there is the question of the ^M chars appearing, the way out is to do a dos2unix on the script file. This is done manually.
Is there a way to call... (4 Replies)
Discussion started by: vino
4 Replies
2. UNIX for Dummies Questions & Answers
Hi this is my first time on this forum so sorry if I posted this to the wrong area.
I need help with the following. I have a basic FormMail cgi script I use. When I upload the script using filezilla, there is one line in the script that changes. The line should read &get_date; instead it... (2 Replies)
Discussion started by: lydp101
2 Replies
3. Shell Programming and Scripting
Please help me with my script please. I am trying to do the following:
1. Read files for the current directory
2. Open and read from nbe files files only
3. Read only the lines with the results pattern
4. Split the line and print 3rd field
Please indicate what line I need to modify. ... (8 Replies)
Discussion started by: jroberson
8 Replies
4. Shell Programming and Scripting
hi,
need some urgent inputs.....
I have a folder, which has both files and directories as its contents.
I want to convert all the files (Excluding the directories) from dos to unix mode using the command 'dos2unix'.....
please can any one help me in providing the command to convert... (3 Replies)
Discussion started by: cmaroju
3 Replies
5. Shell Programming and Scripting
#!/usr/local/bin/perl
open (MYFILE, 'logs_report');
while (<MYFILE>) {
$rec=$_;
chomp ($rec);
@arr=split(/ /,$rec);
print $rec,"\n" if ($arr!~/OK/);
open (MYF, '>data.txt');
print $rec,"\n" if ($arr!~/OK/);
close (MYF); (14 Replies)
Discussion started by: SkySmart
14 Replies
6. Shell Programming and Scripting
Can someone tell me what I'm doing wrong with my perl script? I am new to Perl. This isn't even the final script, I'm just testing to see if it will print the directories with the files in it. For some reason my output is only printing the 1st, 6th, and last entries of the @sub_dir array. Each... (3 Replies)
Discussion started by: man
3 Replies
7. Web Development
Hi Everybody,
I was wondering if it was possible for someone to gain access to my Perl CGI scripts before they are interpreted by Perl (mod_perl on apache2) i.e. getting a hold of my raw scripts and not the html output?
Let's say I use the DBI module where I have the hostname, user and... (2 Replies)
Discussion started by: z1dane
2 Replies
8. Shell Programming and Scripting
Hi All,
I have a perl script which I am using in Windows environment. There is one more file called "functions.txt" which is having all the functions defined to used in my perl script. And the path for this function file is defined in my perl script. Howeever sometimes I am getting below error... (4 Replies)
Discussion started by: gr8_usk
4 Replies
9. Red Hat
Hello Friends,
I have observed one recent issue about ftp from windows to Linux.
Initially we had Solaris unix and any file sent from windows to solaris via ftp (binary or ascii) worked smoothly.
Say for e.g if I sent a shell script to soalris from windows, that script used to run corectly.... (17 Replies)
Discussion started by: Albert_Pinto7
17 Replies
10. Shell Programming and Scripting
I'm not sure why but my script quits automatically at the point where unix2dos / dos2unix command is used. :confused::confused::confused:
How do a fix it?
LOG_FILE=MADDY.txt
unix2dos ${LOG_FILE}
exec 2> $LOG_FILE 1>&2
echo ${LOG_FILE}
The script exists after the below... (3 Replies)
Discussion started by: machomaddy
3 Replies
LEARN ABOUT DEBIAN
explain_fileno_or_die
explain_fileno_or_die(3) Library Functions Manual explain_fileno_or_die(3)
NAME
explain_fileno_or_die - check and reset stream status and report errors
SYNOPSIS
#include <libexplain/fileno.h>
int explain_fileno_or_die(FILE *fp);
int explain_fileno_on_error(FILE *fp);
DESCRIPTION
The explain_fileno_or_die function is used to call the fileno(3) system call. On failure an explanation will be printed to stderr, obtained
from the explain_fileno(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_fileno_on_error function is used to call the fileno(3) system call. On failure an explanation will be printed to stderr,
obtained from the explain_fileno(3) function, but still returns to the caller.
fp The fp, exactly as to be passed to the fileno(3) system call.
RETURN VALUE
The explain_fileno_or_die function only returns on success, see fileno(3) for more information. On failure, prints an explanation and
exits, it does not return.
The explain_fileno_on_error function always returns the value return by the wrapped fileno(3) system call.
EXAMPLE
The explain_fileno_or_die function is intended to be used in a fashion similar to the following example:
explain_fileno_or_die(fp);
SEE ALSO
fileno(3)
check and reset stream status
explain_fileno(3)
explain fileno(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_fileno_or_die(3)