10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
When I run this
#!/bin/bash
Block count: 421958912
Reserved block count: 4219589
perl -e "printf(\"%.1lf%%\n\", ($Reserved block count * 100.0 ) / $Block count);"
I get these error messages. Can someone please help me?
andyk_~/Downloads$ Show_Percent_Reserved_Blocks.sh... (4 Replies)
Discussion started by: drew77
4 Replies
2. Programming
co
#! /usr/bin/perl
use strict;
use warnings;
use diagnostics;
my $amount=""; my $bain; ; my $code="";
my $date;my $day;my $line; my $mo; my $LNUM = 0;
my $xyz=""; my $yr;
$yr = 2015;
my $F; my @F;
while (<>) {
chop;
++$LNUM;
@F = split(';');
if ( $F eq "Date" )... (1 Reply)
Discussion started by: hpk
1 Replies
3. Shell Programming and Scripting
Hello all,
I have a problem with a bash script. It contains an MySQL query, which when I run it 'as is', executes without a problem.
When, however, I try to get it to assign its output to a variable, using the backtick, I get errors.
So ..
/usr/bin/mysql -N -B mydatabase -e 'SELECT... (3 Replies)
Discussion started by: davidm123SED
3 Replies
4. Programming
Hi Guys,
Hope everyone is fine :)
I have this code below:
#!/usr/bin/perl
$num_of_files=`ls | grep -v remover | wc -l`;
$remover=`ls -lrt | grep -v total | grep -v remover | head -1 | awk '{print $8}' | rm \`xargs\``;
if ($num_of_files>3) {
system ($remover);
}
When I... (3 Replies)
Discussion started by: rymnd_12345
3 Replies
5. Shell Programming and Scripting
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)
Discussion started by: shekhar2010us
8 Replies
6. Shell Programming and Scripting
Hi,
Can some one please tell me how to redirect only errors to the log file using perl.
Thanks,
Anjan.
---------- Post updated at 08:41 PM ---------- Previous update was at 08:39 PM ----------
Also, i dont want to use any module. Please tell me in normal way (1 Reply)
Discussion started by: Anjan1
1 Replies
7. Shell Programming and Scripting
Hi,
I am a newbie to PERL and working on a script. When running it I get a lot of compilation errors.
The actual command in the program (which is within a case structure) is given below
# This gives the actual count of inquires from a log file (It works fine when I type this on the... (2 Replies)
Discussion started by: nurani
2 Replies
8. Shell Programming and Scripting
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)
Discussion started by: jeffw_00
6 Replies
9. Shell Programming and Scripting
All,
Does it matter what perl verios your running when you get syntax errors?
on version 5.6.1 the code works fine, but on 5.8.0 the code gets errors?
#!/usr/bin/perl
#use strict;
#use warnings;
my $mess = 'messages';
my $mess1 = 'messages.1';
my $mess2 = 'messages.2';
my... (13 Replies)
Discussion started by: bigben1220
13 Replies
10. Shell Programming and Scripting
Can I know how to express the '(backtick) in awk?!
By typing \' ??? (8 Replies)
Discussion started by: patrick87
8 Replies