Search Results

Search: Posts Made By: Scrutinizer
53,991
Posted By Scrutinizer
ksh93: if (( 12.14>12.13 )); then echo greater;...
ksh93:
if (( 12.14>12.13 )); then echo greater; fi
bash:
if (( $(bc <<< "12.14>12.13") > 0 )); then echo greater; fi
posix:
if [ $(echo "12.14>12.13"|bc) -gt 0 ] ; then echo greater; fi
2,830
Posted By Scrutinizer
Try: awk -F, '$3=="bcd"{$0=$0 FS...
Try:
awk -F, '$3=="bcd"{$0=$0 FS substr($NF,4,1)}1' file
3,316
Posted By Scrutinizer
Perhaps also: awk '$5!~/^[01]$/' file or ...
Perhaps also:
awk '$5!~/^[01]$/' file
or
awk '$5>1' file
2,492
Posted By Scrutinizer
Hi, try: grep "^${disk1} " -o...
Hi, try:
grep "^${disk1} " -o --max-count=1
5,087
Posted By Scrutinizer
Explanation
You're welcome..

Awk is somewhat unique in the sense that it allows you to specify a different record separator, other than the typical newline, which is absent in your case.

By specifying a...
5,087
Posted By Scrutinizer
Unix utilities typically need a linefeed at the...
Unix utilities typically need a linefeed at the end of the line. You could try awk:

awk '/test12-42213.devserver.com/,/EndTime/; END{printf "\n"}' RS=, ORS=, file
or
awk -v...
2,344
Posted By Scrutinizer
Why single line? Another croc to try: awk...
Why single line? Another croc to try:
awk 'NR>2{e="N"; exit 1} END{printf "##### THE LOTC cluster state IS %sOK ##########\n",e}' file
1,772
Posted By Scrutinizer
You need to use double quotes, rather than single...
You need to use double quotes, rather than single ones in this case. Shell variables inside single quotes do not get expanded.
3,412
Posted By Scrutinizer
Hi, it does not work that way. Instead try: ...
Hi, it does not work that way. Instead try:
oflnb=${oflna%.*}
23,804
Posted By Scrutinizer
Not sure if this applies here. One time I came...
Not sure if this applies here. One time I came across a excessive load pattern with no increase of cpu and io, was when there were a lot of processes in uninterruptible sleep state (D), which...
Forum: What is on Your Mind? 02-13-2020
7,433
Posted By Scrutinizer
Thank Neo, for this great honour and your kind...
Thank Neo, for this great honour and your kind words!

I agree that there are many who deserve this title and I feel honoured to be among them..

I am glad to be part of this wonderful community...
2,912
Posted By Scrutinizer
Good to hear the suggestion seems to work out for...
Good to hear the suggestion seems to work out for you :)
Let me explain what it means:
while ( ytd_date !~ /^[01][0-9][0-3][0-9][901][0-9]$/ ) {
This is a so-called "regular expression" , which...
13,722
Posted By Scrutinizer
Try this adaptation of RudiC's suggestion: ...
Try this adaptation of RudiC's suggestion:

awk '
/@inlineifset/ {
if(/@btpar/) {
$1 = $1
gsub(/@inlineifset{mrg, @btpar{@|,,,,}}/, "")
}
print
}
' RS=...
5,089
Posted By Scrutinizer
Using RudiC's suggestion of -M , using GNU sort ...
Using RudiC's suggestion of -M , using GNU sort
sort -k4n -k1,1M -k2,3n file
Would complete the sort.
2,912
Posted By Scrutinizer
Hi, Try changing: while ( ytd_date !~...
Hi,

Try changing:
while ( ytd_date !~ /^[01][0-9][0-3][0-9][901][0-9]$/ ) {
into
while ( ytd_date !~ /^[01][0-9][0-3][0-9][0-9][0-9]$/ ) {
and try and test if that might work out for you...
3,597
Posted By Scrutinizer
Here are some more alternatives to try: Use...
Here are some more alternatives to try:

Use a here string
read var1 var2 <<< "$(openstack hypervisor stats show | awk -F'|' 'NR==14{print $2,$3}')"
Use a here document
read var1 var2 << EOB
...
19,358
Posted By Scrutinizer
Hi, a pipe appears to be missing: egrep -v...
Hi, a pipe appears to be missing:
egrep -v '^listener' |\
4,431
Posted By Scrutinizer
Try: xargs -n3 < file You can experiment by...
Try:
xargs -n3 < file
You can experiment by varying the number and see what it does.
1,040
Posted By Scrutinizer
Hi, try: awk -F, 'NF>5' file It prints lines...
Hi, try:
awk -F, 'NF>5' file
It prints lines where the number of fields (NF) is more than 5, using a comma as a field separator (-F,)
22,477
Posted By Scrutinizer
Classes like [:ascii:] and [:word:] are non-POSIX...
Classes like [:ascii:] and [:word:] are non-POSIX additional classes that can be found in perl, but are not recognised by standard sed.

Instead of [:ascii:], with GNU sed you could try a regex...
5,935
Posted By Scrutinizer
That is because the find command produces a list...
That is because the find command produces a list of files, but wc -l turns it in just a count (number). Also the information is not being transferred to the mail command.

You could try something...
11,546
Posted By Scrutinizer
Hi, in order for xargs to use NUL character...
Hi,

in order for xargs to use NUL character as separator, the utility before the pipe needs to produce them.

try:

mdfind -0 -onlyin . "Note" | xargs -0 -I {} echo {}
or
tag -0 -f "Note" ....
11,546
Posted By Scrutinizer
If you use this: s/^/\./ Then the . is added...
If you use this:
s/^/\./
Then the . is added at the beginning of the path.
To add it to the last item in the path, try:
s|.*/|$0/.|
11,546
Posted By Scrutinizer
Try this instead: s|(.*)/|$1/.|
Try this instead:
s|(.*)/|$1/.|
Forum: What is on Your Mind? 01-24-2020
9,360
Posted By Scrutinizer
Congratulations Victor and Ravinder! Well and...
Congratulations Victor and Ravinder! Well and truly earned, both of you in different, valuable ways. Thank you for your contributions!
Showing results 1 to 25 of 500

 
All times are GMT -4. The time now is 05:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy