In this following command:
awk 'BEGIN{ORS=""}1'
what does '1' signifies that comes after closing curly brace '}' of awk? I guess, it does not mean 'first occurrence' because I verified that.
And, pls tell me how to override or suppress awk's field variables like $1, $2.. by positional... (7 Replies)
Hi All,
I have 2 variables. Result1 and Result2. I want to put a condition that if Both are True then echo "All True" Else Show Error.
Right now i am doing this and getting error.
if ;
then
echo "All True"
else
echo "Failed"
fi;
Error.
line 8: '
Solution: Looking for (2 Replies)
I really don't know the meaning of these operators. Could someone explain the meanings so I can make my test for today?
<, <=, ==, !=, >=, >,
||, &&, ! ~ , !~
Thanks! (1 Reply)
Hi,
I am having the following doubts on awk. Please clarify for me.
a) What does it mean?
awk '$1=$1' and how does it change if I append FS="" to the above code?
b) What if I use awk -vFS="\n" (i.e) setting (input) field separator to newline char, then what will be the value of $0,... (6 Replies)
Hi
Lets say I have two arrays:
VAR_1 = "File_A" "File_B" "File_C" "File_D"
VAR_2 = "File_A" "File_D"
Is there a simple command to get the difference of these list, i.e.
VAR_1_2 = "File_B" "File_C"
or do I have to write a script and loop through all elements and compare them one by one?
... (1 Reply)
Hi all,
I have a variable which is having the value like below,
$ echo ${p}
8 15 22 30
$
My requirement is that the variable should return true when it contains only one number like below,
$ echo ${p}
15
$
Otherwise, it should return false if it contains more than one number.
I... (4 Replies)
Hey everyone, I'm really getting into learning C, but as I look at more advanced example code, I see things like
if (!*variable1)
blah blah blah...
and
variable2 ^= *(variable1++);
my question is, when you have a combination of two operators, like !*. The ! means 'not' and the *... (2 Replies)