---------- Post updated at 11:52 AM ---------- Previous update was at 10:05 AM ----------
Quote:
Originally Posted by jim mcnamara
Does this help?
Can I pick your brains a bit more?
OK, so I got that script to run, and it returns '0' - which is what it should return when everything's OK.
If it returns a non-zero result, I have to run the same SQL request, only ... well, this (note that the variable names are slightly different!) ..
If there is one result to that query, then that's fine. But what if there are several? I tried an array in a bash shell - which is something I've never done, so a lot of googling was required, and came up with .. OK, here is the entire script..
And then I cat the file and pipe it to mail.
For the moment, that always returns zero, but I'm not entirely sure that the day '$result' is non-zero, that I'm going to get an array.
I could probably do this in PhP, but it's not on the server, and it's a production box, so I can't install it.
Hello,
Can't we use backtick operator inside awk.
nawk '
BEGIN {
RS=""; FS="\</input\>"
}
{
for(i=1;i<=NF;i++) {
if ($i~/\"\"/) {
print `grep XYZ $i`;
print $i
}
}
}
' test
In the following code, I need to print $i and some... (8 Replies)
It's been covered in lots of places, and I have banged on it for about an hour and I am not making any headway on this particular string.
A weather-related web page I want to monitor has text on the screen, but it changes. Right now, the page has "None issued by this office recently." but in 2... (4 Replies)
When trying to use backticks for system commands, is there a way to read the error messages if a command doesn't execute properly?
I have no problem getting the results if the command is properly executed.
Ex.
my @result = `dir`;
foreach my $line (@result) {
print "Result = $line";... (2 Replies)
Hi - Within perl I want to execute a system command. I want to re-direct all the output from the command to a file (@result = `$cmd`;), but I ALSO want the results to be displayed on the screen (system("$cmd");
The reason is this - if the command completes, I want to process the output. If the... (6 Replies)
For example:
I got a list of file end at .txt. I want all of them do the same command like
grep '^@' and attached it to a output .sh file.
This is the command I type:
ls *.txt | awk '{print "grep \' \^\@\' ",$1}' > txt.sh
My desired output is when I type the command "more txt.sh "
The... (4 Replies)
I'm trying to get GNU screen to show the output of "uptime" for the host being accessed in the current window, but unfortunately, no matter what window I go in, it shows the uptime for the host I originally launched screen in ("adminhost").
Does anyone know how to get this to update from the... (0 Replies)