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)
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)
There are are lots of examples of piping output FROM the 'ls' command TO another command, but how does one pipe output TO the 'ls -l' command?
For example, use 'which' to find a file, then use 'ls -l' to view the permissions, groups, etc. in a single step:
which <filename> | ls -l
returns... (4 Replies)
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)
Hello, the following is generating a error at the line "tmprintf(&tmBundle, _TMC("{0}"),Prompt);"... a bit lost as I am diving into this debug...
Thank you in advance...
int H_YesNo(TMCHAR *Prompt, int DefVal)
{
TMCHAR YesNo = '\0';
tmprintf(&tmBundle, _TMC("{0}"),Prompt);
while... (3 Replies)
Hello,
I need to create an snmp.comf file that defines 2 IPs to the same community string.
Do I need to have 2 community strings with the same name and diff't IPs?
Or should I have 1 string and list the IPs? (comma seperated?)
Example:
rocommunity EC_8000_RO
arguments EC_8000_RO... (2 Replies)
I am writing a perl script to tar multiple files (in unix) from a given directory to a given output directory. I do NOT want the file path included in the tar, so I've flagged the -C option. Example:
tar -cvf tar/1.tar -C htmp/source/ 1-1-1.xml
However, I need to do this for a number of target... (3 Replies)
Hallo everybody,
I have a following problem - I'm doing a map funciont to fill in a HTML table and I want to use some radiobutton groups. Unfortunatelly, they are grouped by names, so I have to add some "counter" that will divide one row from another, and I'm using CGI.pm for generating the... (3 Replies)
Greetings!
Here's what I believe is a "simple one" for the community tonight ;)
What I'm trying to do is assign a "true/false" value to a variable depending upon whether a named process (some-process) exists; and then test for this value in the succeeding logic. I banged my head against the... (2 Replies)
Hey guys, my first post on UNIX Forums(much overdue IMO)!
I've got this bit of code that doesn't seem to be working correctly for an Android app I'm working on:
"screen -S gmod1 -p 0 -X stuff " & "" & command.text & "`echo -ne '\015'`"""
Basically it types command.text(variable determined... (4 Replies)
Discussion started by: stingwraith
4 Replies
LEARN ABOUT V7
expr
EXPR(1) General Commands Manual EXPR(1)NAME
expr - evaluate arguments as an expression
SYNOPSIS
expr arg ...
DESCRIPTION
The arguments are taken as an expression. After evaluation, the result is written on the standard output. Each token of the expression is
a separate argument.
The operators and keywords are listed below. The list is in order of increasing precedence, with equal precedence operators grouped.
expr | expr
yields the first expr if it is neither null nor `0', otherwise yields the second expr.
expr & expr
yields the first expr if neither expr is null or `0', otherwise yields `0'.
expr relop expr
where relop is one of < <= = != >= >, yields `1' if the indicated comparison is true, `0' if false. The comparison is numeric if
both expr are integers, otherwise lexicographic.
expr + expr
expr - expr
addition or subtraction of the arguments.
expr * expr
expr / expr
expr % expr
multiplication, division, or remainder of the arguments.
expr : expr
The matching operator compares the string first argument with the regular expression second argument; regular expression syntax is
the same as that of ed(1). The (...) pattern symbols can be used to select a portion of the first argument. Otherwise, the
matching operator yields the number of characters matched (`0' on failure).
( expr )
parentheses for grouping.
Examples:
To add 1 to the Shell variable a:
a=`expr $a + 1`
To find the filename part (least significant part) of the pathname stored in variable a, which may or may not contain `/':
expr $a : '.*/(.*)' '|' $a
Note the quoted Shell metacharacters.
SEE ALSO ed(1), sh(1), test(1)DIAGNOSTICS
Expr returns the following exit codes:
0 if the expression is neither null nor `0',
1 if the expression is null or `0',
2 for invalid expressions.
EXPR(1)