Search Results

Search: Posts Made By: sand1234
3,653
Posted By sand1234
Assistance to calculate number of hugepages
Hi,

I am trying to count the number of hugepages & total usage being used by applications..

INPUT FILE
==========

[root@xxx~]# grep huge /proc/*/numa_maps 2>/dev/null...
3,030
Posted By sand1234
Hi Chubler_XL, Appreciate the clarification....
Hi Chubler_XL,

Appreciate the clarification.

What is the purpose of two "<" ? Does it mean that each value from awk will be assigned to the bash variable, with whitespace as delimiter?
...
3,030
Posted By sand1234
Using read to assign value to bash variable not working
Hi,

I am attempting to assign the output of the following command, to two bash variables, var1 and var2 using "read," but it doesn't seem to be working.

[root@xxx ~]# openstack hypervisor stats...
1,361
Posted By sand1234
Hi RudiC, Noted. Your code works well, thank...
Hi RudiC,

Noted. Your code works well, thank you.

BTW, this is what I had before, which was not working.

awk '/show memory compare start/{
getline; print

}
...
1,361
Posted By sand1234
awk to capture memory difference
Hi,

I have a file which consists of the following information in repeating blocks.


************First iteration***************

xr_lab#show memory compare start
Thu Sep 19 14:38:06.400 WIB ...
1,881
Posted By sand1234
Hi RavinderSingh13, That part is clear for...
Hi RavinderSingh13,

That part is clear for me.

The part which is confusing is the logic after ?

I believe it should be as per RudiC logic.

Your logic
awk...
1,881
Posted By sand1234
Hi RavinderSingh13, Nice find, the following...
Hi RavinderSingh13,

Nice find, the following matches the correct lines.

$ awk 'length($0)==80' unwrap2.txt
2019 Sep 28 10:47:24.695 hkaet9612 %ETHPORT-5-IF_DOWN_INTERFACE_REMOVED: Interfa...
1,881
Posted By sand1234
Hi RavinderSingh13, Thanks for the...
Hi RavinderSingh13,

Thanks for the explanation and solution.

However in this case we need to match on lines which have 80 character length.

I changed your solution to the one below.
...
1,881
Posted By sand1234
Hi RavinderSingh13, The code works, although...
Hi RavinderSingh13,

The code works, although the last line does not have '\n'

root@localhost# awk '{printf("%s%s",$0~/^[0-9]+/ && FNR>1?ORS:FNR==1?"":OFS,$0)}' unwrap.txt
2019 Sep 28...
1,881
Posted By sand1234
Merging two lines into one (awk)
Hi,

I am attempting to merge the following lines which run over two lines using awk.

INITIAL OUTPUT

2019 Sep 28 10:47:24.695 hkaet9612 last message repeated 1 time
2019 Sep 28 10:47:24.695...
3,874
Posted By sand1234
Using awk to split a column into two columns
Hi,

I am trying to split the following output into two columns, where each column has Source: Destination:

OUTPUT TO FILTER

$ tshark -r Capture_without_mtr.pcap -V | awk '/ ...
1,660
Posted By sand1234
Hi Neo, I didn't know about that - thanks!...
Hi Neo,

I didn't know about that - thanks! It looks like this will be useful.

Cheers.
1,660
Posted By sand1234
Actually, it looks like this might be more than...
Actually, it looks like this might be more than an exercise. It appears that skyscanner provides us with a method to "Get Price Alerts" if there are fluctuations in the ticket price, however I don't...
1,660
Posted By sand1234
Facing difficulty scraping website with curl
Hi,

As an exercise, I am attempting to scrape the following website to obtain ticket price for a certain journey, so I can capture the cheapest ticket by running the script hourly.
...
10,047
Posted By sand1234
Hi MadeinGermany, Thanks for the responses,...
Hi MadeinGermany,

Thanks for the responses, nice idea(s). The line without => is not captured via your regex, however DonCragun has provided some details around this.

...
10,047
Posted By sand1234
Hi MadeinGermany, Thanks for the tips. ...
Hi MadeinGermany,

Thanks for the tips.

The first solution does not work,

./copy_chroot_lib.sh ls echo | sed -n 's#\(/lib\).*#\1#p'
libselinux.so.1 => /lib
libc.so.6 =>...
10,047
Posted By sand1234
UPDATE: I have managed to get the desired output...
UPDATE: I have managed to get the desired output using tr/awk, but continue to leave it open for alternative solutions. Thanks!

./copy_chroot_lib.sh ls echo | tr '=>' '\n' | awk '/\/lib/{print...
10,047
Posted By sand1234
Cannot extract libraries using sed
Hi,

I am attempting to extract the /lib/ paths using sed but it does not appear to work.

./copy_chroot_lib.sh ls echo | sed s#*\(/lib\).*#\1#g
linux-vdso.so.1 (0x00007fff77df1000)
...
2,696
Posted By sand1234
Hi balajesuri, Thank you for providing a...
Hi balajesuri,

Thank you for providing a solution.

In this case can you explain why the question mark is needed in (?!Clear)

I understand that !Clear means do not match clear, but would...
2,900
Posted By sand1234
Using sed to split hex string
Hi,

I'm looking to split the following hex string into rows of four elements.

I've tried the following but it doesn't seem to work. How can I tell sed to match based on a pair of number(s) and...
2,696
Posted By sand1234
Grep -P does not capture the desired output
Hi,

I'm trying to filter the following output to only display information about an alarm where the Status: corresponds to Set.

--------------------------------------------------------...
2,545
Posted By sand1234
Need to save output of echo and awk to a file
Hi,

I am generating a YAML file from a hosts file, but am having trouble saving it to a new file.

hosts file
127.0.0.1 localhost
192.168.1.2 host1
192.168.1.3 host2
192.168.1.4 ...
2,300
Posted By sand1234
discussing further with RudiC
Hi RudiC,

Interesting to know - when you say a pointer do you mean a pointer, say in the C programming language? Or just a pointer to the location.

In terms of for loop, I was wondering whether...
2,300
Posted By sand1234
Hi RudiC, That works perfectly. awk...
Hi RudiC,

That works perfectly.

awk '{printf "%04x %s\n", counter, $0; counter += NF}' capture.txt


From what I understand, %04x pads the first element with 0s to make up 4 digits in hex,...
2,300
Posted By sand1234
Need to convert bytearray into text2pcap format
Hi,

I'm looking for a method to add hex increments as a first column to the following file.

Something like this:

0000
0010
0020
0030
0040
0050
0060
0070
0080
0090
00a0
00b0
00c0...
Showing results 1 to 25 of 36

 

Featured Tech Videos

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