Skip to main content

Questions tagged [awk]

The AWK utility is a data extraction and reporting tool that uses a data-driven scripting language consisting of a set of actions to be taken against textual data (either in files or data streams) for the purpose of producing formatted reports.

1 vote
5 answers
564 views

I have a comma separated line I am using awk to extract fields from. Server1,poweredOn,10.0.18.70,"Blue, Green",POC,Vsphere However, when it comes to the text in double quotes ("Blue, ...
adamtjgogo's user avatar
0 votes
1 answer
109 views

I'm trying to write a script that will read search strings from an input file and then execute a command with $string in the middle of the command line. This is an example of the working command line:...
Drew's user avatar
  • 101
0 votes
2 answers
376 views

I need to display each IBM MQ Queue Manager queue along with its depth. I can do this with a command like echo DISPLAY QLOCAL(QE*) WHERE(CURDEPTH GE 0) | runmqsc QMNAME. The output is similar to this: ...
markfree's user avatar
  • 143
0 votes
2 answers
170 views

I am having an issue in a PHP application, where some processes seem to run for days - still trying to work out how/why but, whilst this happens, the resources on the server get zapped and loads goes ...
bhttoan's user avatar
  • 650
0 votes
1 answer
123 views

I am not an expert with awk tool. I must miss something obvious... What works so far: [root@checkmk ~]# awk '/^[[:blank:]]*SSLCertificateFile/ {gsub(/\/etc\//, "/not_etc/")} 1' \ /etc/httpd/...
gabrielgbs97's user avatar
0 votes
2 answers
703 views

I have a directory that looks like so : /path/to/files/data-file.1 /path/to/files/data-file.2 /path/to/files/data-file.3 /path/to/files/data-file.4 /path/to/files/data-file.5 /path/to/files/data-file....
Ror's user avatar
  • 383
2 votes
3 answers
835 views

I need to filter a row of a csv file by a date. The file is structured as so: [email protected] active 01/24/11 10:04 07/23/23 16:56 ...
dj423's user avatar
  • 23
2 votes
1 answer
651 views

I've seen many more or less related topics, but all I found discuss how to color awk output. I need to preserve the color that was provided as awk input. For example, now I have: ./some_command (...
Putnik's user avatar
  • 2,507
3 votes
1 answer
1k views

I have an ldapsearch query to pull some data of an email system, I am trying to parse the data into something I can analyze in a table/flat file, and generate reports on the accounts. Sample of the ...
dj423's user avatar
  • 53
2 votes
2 answers
363 views

I have the below data (lscpu output) for 1000 servers and I want the same in excel but in row format and not as in command output in columns 1.2.3.4 CHANGED Architecture: ...
Loki's user avatar
  • 21
-1 votes
1 answer
272 views

I have a file that looks like the following: /path/to/a/very/long/path 0 0 0 0 0 0 I need to move the line starting with a number (this can be any value not necessarily 0) to the end of the ...
djc72uk's user avatar
  • 33
4 votes
1 answer
3k views

It isn't clear exactly what more needs to be escaped in the following macro to allow it to be used with awk or sed on FreeBSD. define(`RELAY_MAILER_ARGS', `TCP $h 2525')dnl Here is an awk command ...
Utkonos's user avatar
  • 398
0 votes
1 answer
562 views

I have these strings: Certificate Name: domain1.com Serial Number: 37aadb8fae7b908e1228c3e71 Domains: domain1.com www.domain1.com Expiry Date: 2022-11-20 02:14:29+00:00 (VALID: 3 days) ...
Budianto IP's user avatar
0 votes
0 answers
92 views

I have the below script running successfully manually. But when it is executed in crontab (below), I dont see anything happening. Script #!/usr/bin/gawk -f #!/bin/bash PATH=/usr/local/bin:/usr/bin #...
serverstackqns's user avatar
0 votes
1 answer
217 views

How can I add a variable within awk command? below is my command: cat /home/ubuntu/test/copy.txt | awk 'NR==21{print ".host = "$line";"}1' $line is basically an IP address which ...
serverstackqns's user avatar

15 30 50 per page
1
2 3 4 5
14