I confused about syntax used in OR script as follow:
I have this sample file separated by "|" containing: And I´m excluding 6 lines containing the first 6 months with this awk script (and works fine): The problem is when I try to write the same one-line command in 2 or more lines, because I get errors, I mean:
What I´m doing wrong? how can I fix it?
* I try to do this because in the real file I need to exclude more than 20 patterns from a column and the one-line command becomes too long.
Hi there could someone explain what is happening in the following function/statement for me, im just a little confused
code = 'BEGIN{FS=","}
{
printf ("%-11s,%s%s%s,%07.2f,%14s,%-3s\n",$1,substr($2,9,2),substr($2,6,2),substr($
2,3,2),$9,$10,$12)
}
this function is called later in the... (2 Replies)
I am trying to print the remaing fields and field numbers beginning with a field 'xyz'
#cat abc
test1:test2:xyz:test3:test4:test5
#cat def
test1:test2:test3:xyz:test4:test5
desired output is to be able to print NF and any trailing fields separated by':'
test3 3
or
test4 3
or
test5... (4 Replies)
Hi,
Have to check file names in some given directory.
SO, What is the right syntax here:
*$3*=="'$object_list'" - just wanted to check if $3 is in the object_list.
And also, Do I need so many quotes around? (5 Replies)
When i tyr this, it gives me a syntax error...i tried removing quotes,removing spaces,replacing -eq with '='.. Can somebody suggest that is the problem?
if ]; then (4 Replies)
Hi All,
can some one figure out the syntax issue here. How to overcome this?
#!/bin/sh
$ HFR_MAIL=NO
$ PRP_MAIL=NO
$ MC_MAIL=NO
$ if && && ]; then
> echo "NO "
> else
> echo "YES"
> fi
test: unknown operator NO
$ if && && ]; then
> echo "NO"
> else
> echo "YES"
>... (4 Replies)
Hi,
Can someone give me an example of how to use zsh's ternary operator?
I tried:
# a=1
# c=( a ? "true" : "false" )
and got:
zsh: no matches found: ?
I'm running zsh 4.2 on RHEL AS 4.
Thanks!
Paul (1 Reply)
Hi
I use awk command to delete the first blanc line of a file:
awk '/^$/ && !f{f=1;next}1' infile > outfile
can somebody please explain me what the last "1'" in !f{f=1;next}1' stands for... Thansk a lot -A (3 Replies)
hi,
i have a bash script that i want to receive a a string from another bash file. But because the string has a dot in the middle it gives me an error. The error is in this line:
let valor=$1
and the value passed is rules.txt
the error is:
let: valor=rules.txt: syntax error: invalid... (2 Replies)
Hello all,
I am writing up an input file and I was hoping I could get some guidance as to how to best consolidate these 2 awk statements for 1 while loop.
Here's my input file
# cat databases.lst
#NOTE: These entries are delimited by tabs "\t"
#oracleSID name/pass
#
db11 ... (2 Replies)
split($7,a," "); date = a; time = a
split(date,d,"/"); month = sprintf("%02d",d); day = sprintf("%02d",d); year = 2000 + d % 100
split(time,t,":"); hour=t; min=t
hour >= 12? { hour=hour-12; amPm=" PM" } : amPM=" AM"
hour == 0? hour=12
time=sprintf("%02d",hour)":"sprintf("%02d",min)amPm
... (4 Replies)
Discussion started by: Michael Stora
4 Replies
LEARN ABOUT ULTRIX
nl_langinfo
nl_langinfo(3int)nl_langinfo(3int)Name
nl_langinfo - language information
Syntax
#include <nl_types.h>
#include <langinfo.h>
char *nl_langinfo (item)
nl_item item;
Description
The function returns a pointer to a null-terminated string containing information relevant to a particular language or cultural area. The
language is identified by the last successful call to the appropriate category. The categories are shown in the following table and are
defined in
For instance, the following example would return a pointer to the string representing the abbreviated name for the first day of the week,
as defined by category
nl_langinfo (ABDAY_1);
If the category has not been called successfully, data for a supported language is not available, or is not defined, then returns a pointer
to an empty (null) string. In the C locale, the return value is the American English string defined in the following table:
-----------------------------------------------------------------------
Identifier Meaning C locale Category
-----------------------------------------------------------------------
NOSTR Negative response no LC_ALL
YESSTR Positive response yes LC_ALL
D_T_FMT Default date and time format %a %b %d
%H:%M:%S %Y LC_TIME
D_FMT Default date format %m/%d/%y LC_TIME
T_FMT Default time format %h:%m:%s LC_TIME
DAY_1 Day name Sunday LC_TIME
DAY_2 Day name Monday LC_TIME
.... .... .... ....
DAY_7 Day name Saturday LC_TIME
ABDAY_1 Abbreviated day name Sun LC_TIME
ABDAY_2 Abbreviated day name Mon LC_TIME
ABDAY_3 Abbreviated day name Tue LC_TIME
.... .... .... ....
ABDAY_7 Abbreviated day name Sat LC_TIME
MON_1 Month name January LC_TIME
MON_2 Month name February LC_TIME
MON_3 Month name March LC_TIME
.... .... .... ....
MON_12 Month name December LC_TIME
ABMON_1 Abbreviated month name Jan LC_TIME
ABMON_2 Abbreviated month name Feb LC_TIME
.... .... .... ....
ABMON_12 Abbreviated month name Dec LC_TIME
RADIXCHAR Radix character . LC_NUMERIC
THOUSEP Thousands separator LC_NUMERIC
CRNCYSTR Currency format LC_MONETARY
AM_STR String for AM AM LC_TIME
PM_STR String for PM PM LC_TIME
EXPL_STR Lower case exponent character e LC_NUMERIC
EXPU_STR Upper case exponent character E LC_NUMERIC
-----------------------------------------------------------------------
See Alsointro(3int), ic(1int), setlocale(3int), environ(5int), nl_types(5int)
Guide to Developing International Software
nl_langinfo(3int)