Sponsored Content
Full Discussion: awk and execute command ???
Top Forums Shell Programming and Scripting awk and execute command ??? Post 302069675 by vgersh99 on Tuesday 28th of March 2006 10:18:44 AM
Old 03-28-2006
Quote:
Originally Posted by sabercats
I use awk because I want to findout $3 is 5, then take $1 and $2, I really dont know what will be $1 and $2 .Just use it to move or execute another script Smilie
ok. what's your point?
have looked at/tried the posted suggestion?

Last edited by vgersh99; 03-28-2006 at 12:31 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How does this command execute?

Can somebody give me the explanation for this command line: ps>newfile<infile wc -l ? I am totally confused with the order of its execution.. :confused: Thanx, Saneesh Joseph. (3 Replies)
Discussion started by: saneeshjose
3 Replies

2. UNIX for Dummies Questions & Answers

Plz Help : How to use write command to execute command on some other terminal

Hi Group , I m trying to execute commands on some other system using write command but inspite of executing the commands they r passed as simple messages. - i m writing >write user-id ! ls o ctrl-d inspite of executing the command ls,other terminal shows ! ls. Thnx in advance. (2 Replies)
Discussion started by: Aashish
2 Replies

3. Shell Programming and Scripting

How to build a command into a string rather than execute the command

I'm trying to populate a command line into a variable. It appears to be executing, instead. Here's an example: mycmd='' if ...; then $mycmd='sudo ' fi $mycmd=$mycmd 'sed -i prev s/aaa/bbb/' $myfile res=`$mycmd` (I'm also not sure of the best way to execute the command from the... (1 Reply)
Discussion started by: littlejon
1 Replies

4. UNIX for Dummies Questions & Answers

how to execute an command this way

How to make it works this way? echo dir1\/*.txt ; echo dir1\/*.html | xargs wc -l dir1/*.txt wc: dir1/*.html: No such file or directory what i'm trying to do it to "wc dir1/*.txt" and "wc dir1/*.html" (2 Replies)
Discussion started by: Bornay6ah
2 Replies

5. Shell Programming and Scripting

awk and execute

Hi All, I need this to execute and not just print on Red Hat ent 4 bash shell. cat /etc/passwd|grep db2 | awk -F":" '{print "cat /etc/group | grep ",$4}' Output: cat /etc/group | grep 1000 (I don't want this to print but execute) Thanks for any comment you may add. (2 Replies)
Discussion started by: itik
2 Replies

6. Shell Programming and Scripting

Need help to execute command

HI, I have a directory called input directory called "input", The "input" directory contains file names (file1,file2,file3,file4), I want to write a command so that it will display all the file names with comma separated. Desired output: file1,file2,file3 so on.... Regards Akshay... (2 Replies)
Discussion started by: akshu.agni
2 Replies

7. Shell Programming and Scripting

Execute command from awk

This seemed straight forward until I tried to code it. I'm running ioscan -fuNC disk to get list of disk including hardware path. What I'm trying to do is use awk to take this output, extract hardware path, and pass that as a variable to ioscan -P wwid -N -H 64000/0xfa00/0x1a | grep ^disk and... (11 Replies)
Discussion started by: steve72
11 Replies

8. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

9. Shell Programming and Scripting

How to execute a command on each line of output from another command?

Hello :) new to bash not to programming. I have an on-going need to change the owning group on sets of files and directories from the one they were created with or changed to on update to the one they need to have going forward. find {target_root} -group wrong_group gets me a newline... (4 Replies)
Discussion started by: naftali
4 Replies

10. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
DateTime::Span(3pm)					User Contributed Perl Documentation				       DateTime::Span(3pm)

NAME
DateTime::Span - Datetime spans SYNOPSIS
use DateTime; use DateTime::Span; $date1 = DateTime->new( year => 2002, month => 3, day => 11 ); $date2 = DateTime->new( year => 2003, month => 4, day => 12 ); $set2 = DateTime::Span->from_datetimes( start => $date1, end => $date2 ); # set2 = 2002-03-11 until 2003-04-12 $set = $set1->union( $set2 ); # like "OR", "insert", "both" $set = $set1->complement( $set2 ); # like "delete", "remove" $set = $set1->intersection( $set2 ); # like "AND", "while" $set = $set1->complement; # like "NOT", "negate", "invert" if ( $set1->intersects( $set2 ) ) { ... # like "touches", "interferes" if ( $set1->contains( $set2 ) ) { ... # like "is-fully-inside" # data extraction $date = $set1->start; # first date of the span $date = $set1->end; # last date of the span DESCRIPTION
"DateTime::Span" is a module for handling datetime spans, otherwise known as ranges or periods ("from X to Y, inclusive of all datetimes in between"). This is different from a "DateTime::Set", which is made of individual datetime points as opposed to a range. There is also a module "DateTime::SpanSet" to handle sets of spans. METHODS
o from_datetimes Creates a new span based on a starting and ending datetime. A 'closed' span includes its end-dates: $span = DateTime::Span->from_datetimes( start => $dt1, end => $dt2 ); An 'open' span does not include its end-dates: $span = DateTime::Span->from_datetimes( after => $dt1, before => $dt2 ); A 'semi-open' span includes one of its end-dates: $span = DateTime::Span->from_datetimes( start => $dt1, before => $dt2 ); $span = DateTime::Span->from_datetimes( after => $dt1, end => $dt2 ); A span might have just a beginning date, or just an ending date. These spans end, or start, in an imaginary 'forever' date: $span = DateTime::Span->from_datetimes( start => $dt1 ); $span = DateTime::Span->from_datetimes( end => $dt2 ); $span = DateTime::Span->from_datetimes( after => $dt1 ); $span = DateTime::Span->from_datetimes( before => $dt2 ); You cannot give both a "start" and "after" argument, nor can you give both an "end" and "before" argument. Either of these conditions will cause the "from_datetimes()" method to die. To summarize, a datetime passed as either "start" or "end" is included in the span. A datetime passed as either "after" or "before" is excluded from the span. o from_datetime_and_duration Creates a new span. $span = DateTime::Span->from_datetime_and_duration( start => $dt1, duration => $dt_dur1 ); $span = DateTime::Span->from_datetime_and_duration( after => $dt1, hours => 12 ); The new "end of the set" is open by default. o clone This object method returns a replica of the given object. o set_time_zone( $tz ) This method accepts either a time zone object or a string that can be passed as the "name" parameter to "DateTime::TimeZone->new()". If the new time zone's offset is different from the old time zone, then the local time is adjusted accordingly. If the old time zone was a floating time zone, then no adjustments to the local time are made, except to account for leap seconds. If the new time zone is floating, then the UTC time is adjusted in order to leave the local time untouched. o duration The total size of the set, as a "DateTime::Duration" object, or as a scalar containing infinity. Also available as "size()". o start o end First or last dates in the span. It is possible that the return value from these methods may be a "DateTime::Infinite::Future" or a "DateTime::Infinite::Past"xs object. If the set ends "before" a date $dt, it returns $dt. Note that in this case $dt is not a set element - but it is a set boundary. o start_is_closed o end_is_closed Returns true if the first or last dates belong to the span ( begin <= x <= end ). o start_is_open o end_is_open Returns true if the first or last dates are excluded from the span ( begin < x < end ). o union o intersection o complement Set operations may be performed not only with "DateTime::Span" objects, but also with "DateTime::Set" and "DateTime::SpanSet" objects. These set operations always return a "DateTime::SpanSet" object. $set = $span->union( $set2 ); # like "OR", "insert", "both" $set = $span->complement( $set2 ); # like "delete", "remove" $set = $span->intersection( $set2 ); # like "AND", "while" $set = $span->complement; # like "NOT", "negate", "invert" o intersects o contains These set functions return a boolean value. if ( $span->intersects( $set2 ) ) { ... # like "touches", "interferes" if ( $span->contains( $dt ) ) { ... # like "is-fully-inside" These methods can accept a "DateTime", "DateTime::Set", "DateTime::Span", or "DateTime::SpanSet" object as an argument. SUPPORT
Support is offered through the "datetime@perl.org" mailing list. Please report bugs using rt.cpan.org AUTHOR
Flavio Soibelmann Glock <fglock@gmail.com> The API was developed together with Dave Rolsky and the DateTime Community. COPYRIGHT
Copyright (c) 2003-2006 Flavio Soibelmann Glock. All rights reserved. This program is free software; you can distribute 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. SEE ALSO
Set::Infinite For details on the Perl DateTime Suite project please see <http://datetime.perl.org>. perl v5.12.4 2011-08-22 DateTime::Span(3pm)
All times are GMT -4. The time now is 11:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy