i'm trying to do this (in bash darwin);
echo "give me some words: "
read a
c=2 # this is get by other ways
echo $a | awk '{print $c}' # i want to print the column given
# by de $c variable
if there is someone understand what i pretend... (3 Replies)
mode=$1
psg telnetd | awk current=`date +%M`'{
printf ("mode is %s",mode)
printf ("mode is %s",ARGV)
}'
at command prompt when i run the script along with the argument i get only--
'mode is '
argument is not printed.(If the argument is... (3 Replies)
Hi all,
I have some code like this
awk -F, '{
if ($1==3)
print $2 > "output_file"
print "1" > "new_file"
}' "input_file"
When I check output_file this has the correct values in it. However the new_file has 1 in it for every line in the input_file. If the input file has 20 lins then... (2 Replies)
Hi Friends,
I have small issue with following code snippet.
I am trying call one function inside awk in which the function inturn will echo few lines. However when i ran script its throwing an error saying "nawk: syntax error at source line 1".
#!/bin/sh
eval input=$@
while read... (3 Replies)
Hello,
is there a way to use the awk print statement on two files at once? I would like to take two columns from one file, and one column from another file and print them as consecutive columns to a third file. Seems simple...as in:
file 1
1 a
2 b
3 c
4 d
5 e
file 2
1 t
2 u... (3 Replies)
Hi, i'm just after a simple explanation of how the following awk oneliner works.
gawk -F"," '{for(i=m;i<=n;i++)printf "%s" OFS,$i; print x}' m=1 n=70 OFS=, input.csv > output.csv
In particular i'm trying to understand how the two print statements work? How is the "x" variable being assigned... (3 Replies)
Hello,
I have a set of files Xfile0001 - Xfile0021, and the content of this files (one at a time) needs to be printed between some line (lines start with word "Generated") that I am extracting from another file called file7.txt and all the output goes into output.txt. First I tried creating a for... (5 Replies)
Hello
can you please help me with below script which is meant to delete clients from multiple netbackup policies
I want to run a command insdie awk statement
apparelnlty this script is not working for me
for i in $( cat clients_list)
do
bppllist -byclient $i | awk... (6 Replies)
Hello folks,
I have multiple occurrences of the pattern:
).:
where is any digit, in various text context but the pattern is unique as this regex. And I need to turn this decimal fraction into an integer (corresponding percent value: the range of 0-100).
What I'm doing is:
cat... (1 Reply)
Discussion started by: roussine
1 Replies
LEARN ABOUT OSX
wcsftime
WCSFTIME(3) BSD Library Functions Manual WCSFTIME(3)NAME
wcsftime, wcsftime_l -- convert date and time to a wide-character string
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <wchar.h>
size_t
wcsftime(wchar_t *restrict wcs, size_t maxsize, const wchar_t *restrict format, const struct tm *restrict timeptr);
#include <wchar.h>
#include <xlocale.h>
size_t
wcsftime_l(wchar_t *restrict wcs, size_t maxsize, const wchar_t *restrict format, const struct tm *restrict timeptr, locale_t loc);
DESCRIPTION
The wcsftime() function is equivalent to the strftime() function, except for the types of its arguments. Refer to strftime(3) for a detailed
description.
While the wcsftime() function uses the current locale, the wcsftime_l() function may be passed a locale directly. See xlocale(3) for more
information.
COMPATIBILITY
Some early implementations of wcsftime() had a format argument with type const char *, instead of const wchar_t *.
SEE ALSO strftime(3), xlocale(3)STANDARDS
The wcsftime() function conforms to ISO/IEC 9899:1999 (``ISO C99'').
BSD September 8, 2002 BSD