Hello,
Can you explain why in the first 2 commands the awk does not print anything? Is it looking of a specific format ?
Thanks.
$ echo 12a3 | awk '($1>=2) {print $1}' # prints nothing
$ echo 123a | awk '($1>=2) {print $1}' # prints nothing
$ echo a123 | awk '($1>=2) {print $1}'
a123... (1 Reply)
Dear Group,
I want to prepare an ELF file which can be downloaded dynamically to any address in the moemory and executes as a new task/thread/process.
1) for this what are all the compileation, linker options while building the ELF file?
2) which parts of ELF file has to modified while... (1 Reply)
how can i specify more than 1 consition in the following AWK statament??
i.e. if $2 is ABCD and $3 is MNOP and $4 is KLPM
similarly for OR
#!/bin/ksh
awk -F '' ' $2 == "ABCD" { print $2, $3;}' file.xml (2 Replies)
Hi Everyone,
# cat 1
1;2;3;4;5;6
1;2;3;4;5;
# awk -F ";" '$5 == "5"' 1
1;2;3;4;5;6
1;2;3;4;5;
but the output is should be just "1;2;3;4;5;6" means 1st condition: $5 is 5; 2nd condition: $6 is not empty, please advice. Thanks (2 Replies)
Hi there, here is my command
ssh host.local "/path/to/my/perscript/hostconfig.pl -s $HOST -d |awk '{if (\$4 > 120)print \"My error message\";exit}{s=0; for (i=1; i<=NF; i++) s++; if(s == 13) print \$3}'"
The problem is if conditional 1 is met (i.e $4 > 120), i don't see "My error message", the... (5 Replies)
Hi All,
I have a file with below contents.
"en2"/10.185.81.0:cluster_interconnect,"en5"/10.185.81.0:cluster_interconnect,"en6"/169.181.146.0:public
I want to take the interface name from the file and convert it as ipaddress using ifconfig command get the output like below
en6 ->... (2 Replies)
I'm having a problem pulling UID's from data. The data outputs a user's UID in one of three ways:
1. Error User user_name already assigned with <UID>
2. Success <UID> reserved for user_name
3. <a load of crap because there was a db failure yet somehow the UID is still in there>
I typically... (5 Replies)
I have written this script. This is used for creating a backup folder.
#!/bin/sh
#set -x
. /home/.profile
usage="Usage is $0"
usage="$usage "
# Use the getopt utility to set up the command line flags.
set -- `/usr/bin/getopt b: $*`
# Process individual command line arguments
while ;... (1 Reply)
Hello Friends,
I need to find some CDRs in production servers whose 1st field value and 2nd field value = 1 and 11th looks like 45.123... where there are more than 3 digits after comma.so i wrote a one liner, something like below but does not work, however when i used first and second conditions... (8 Replies)
dispatch_time(3) BSD Library Functions Manual dispatch_time(3)NAME
dispatch_time, dispatch_walltime -- Calculate temporal milestones
SYNOPSIS
#include <dispatch/dispatch.h>
static const dispatch_time_t DISPATCH_TIME_NOW = 0;
static const dispatch_time_t DISPATCH_TIME_FOREVER = ~0ull;
dispatch_time_t
dispatch_time(dispatch_time_t base, int64_t offset);
dispatch_time_t
dispatch_walltime(struct timespec *base, int64_t offset);
DESCRIPTION
The dispatch_time() and dispatch_walltime() functions provide a simple mechanism for expressing temporal milestones for use with dispatch
functions that need timeouts or operate on a schedule.
The dispatch_time_t type is a semi-opaque integer, with only the special values DISPATCH_TIME_NOW and DISPATCH_TIME_FOREVER being externally
defined. All other values are represented using an internal format that is not safe for integer arithmetic or comparison. The internal for-
mat is subject to change.
The dispatch_time() function returns a milestone relative to an existing milestone after adding offset nanoseconds. If the base parameter
maps internally to a wall clock, then the returned value is relative to the wall clock. Otherwise, if base is DISPATCH_TIME_NOW, then the
the current time of the default host clock is used.
The dispatch_walltime() function is useful for creating a milestone relative to a fixed point in time using the wall clock, as specified by
the optional base parameter. If base is NULL, then the current time of the wall clock is used.
EDGE CONDITIONS
The dispatch_time() and dispatch_walltime() functions detect overflow and underflow conditions when applying the offset parameter.
Overflow causes DISPATCH_TIME_FOREVER to be returned. When base is DISPATCH_TIME_FOREVER, then the offset parameter is ignored.
Underflow causes the smallest representable value to be returned for a given clock.
EXAMPLES
Create a milestone two seconds in the future:
milestone = dispatch_time(DISPATCH_TIME_NOW, 2LL * NSEC_PER_SEC);
Create a milestone for use as an infinite timeout:
milestone = DISPATCH_TIME_FOREVER;
Create a milestone on Tuesday, January 19, 2038:
struct timespec ts;
ts.tv_sec = 0x7FFFFFFF;
ts.tv_nsec = 0;
milestone = dispatch_walltime(&ts, 0);
RETURN VALUE
These functions return an abstract value for use with dispatch_after(), dispatch_group_wait(), or dispatch_semaphore_wait().
SEE ALSO dispatch(3), dispatch_after(3), dispatch_group_create(3), dispatch_semaphore_create(3)Darwin May 1, 2009 Darwin