Hi ,
I have a piece of code ...wherein I need to assign the following ...
1) A command line argument to a variable
e.g origCount=ARGV
2) A unix command to a variable
e.g result=`wc -l testFile.txt`
in my awk shell script
When I do this :
print "origCount" origCount --> I get the... (0 Replies)
Sorry for the duplicate thread this one is similar to the one in
https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121
Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
I have a script problem that I am not able to solve due my very limited understanding of unix/awk.
This is the contents of test.sh
awk '{print $1}'
From the prompt if I enter:
./test.sh Hello World
I would expect to see "Hello" but all I get is a blank line. Only then if I enter "Hello... (2 Replies)
Hello all,
Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val:
> cat getnon0file.sh
#!/bin/bash
this="getnon0file.sh"
USAGE=$this"
InFile="xyz.38"
Min="0.05"
#
awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Hi,
I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files.
To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
below is the output xml string from some other command and i will be parsing it using awk
cat /tmp/alerts.xml
<Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Hi,
I am trying to pass awk field to a command line executed within awk (need to convert a timestamp into formatted date).
All my attempts failed this far.
Here's an example.
It works fine with timestamp hard-codded into the command
echo "1381653229 something" |awk 'BEGIN{cmd="date -d... (4 Replies)
Discussion started by: tuxer
4 Replies
LEARN ABOUT DEBIAN
padre::task::eval
Padre::Task::Eval(3pm) User Contributed Perl Documentation Padre::Task::Eval(3pm)NAME
Padre::Task::Eval - Task for executing arbitrary code via a string eval
SYNOPSIS
my $task = Padre::Task::Eval->new(
prepare => '1 + 1',
run => 'my $foo = sub { 2 + 3 }; $foo->();',
finish => '$_[0]->{prepare}',
);
$task->prepare;
$task->run;
$task->finish;
DESCRIPTION
Padre::Task::Eval is a stub class used to implement testing and other miscellaneous functionality.
It takes three named string parameters matching each of the three execution phases. When each phase of the task is run, the string will be
eval'ed and the result will be stored in the same has key as the source string.
If the key does not exist at all, nothing will be executed for that phase.
Regardless of the execution result (or the non-execution of the phase) each phase will always return true. However, if the string eval
throws an exception it will escape the task object (although when run properly inside of a task handle it should be caught by the handle).
METHODS
This class contains now additional methods beyond the defaults provided by the Padre::Task API.
COPYRIGHT & LICENSE
Copyright 2008-2012 The Padre development team as listed in Padre.pm.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.14.2 2012-06-27 Padre::Task::Eval(3pm)