AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool.
0
votes
1answer
7 views
Loading a file in vim via piped output of ag
I feel as if my scenario is fairly simple but that I might be overcomplicating it.
I am searching through files looking for a special condition, that is where the method ...
2
votes
1answer
47 views
Finding hidden field values in a web page before submitting a login form
In order to submit a login form using wget, I need to find the values for the hidden field that were added to the form recently. Grepping for the names gives the ...
2
votes
1answer
24 views
Listing Docker Images without registry URI
I have a private container registry behind a firewall that will need some Google registry images. To make sure things are updated sanely, I'm writing a mirror script in Bash. I have one line that ...
3
votes
2answers
64 views
Advanced CSV-to-SQLite converter
I just wrote an advanced CSV parser that translates CSV to SQL(SQLite Compatible) statements, which are then inserted into the database. It translates variable names in the CSV to values defined in ...
1
vote
1answer
28 views
Print first element of the last line of files when the second element does not match a pattern
I am relatively new to Bash, regular expression and stuff.
In a directory, I need to read the last line of all the files that contain the word "fitness", and list (on one line and separated with ...
5
votes
2answers
119 views
Shell script to count chess game outcomes
I came across this blog post by Adam Drake from around a year ago which is now making the rounds again.
I made some improvements to his code, but wish to see if there are additional tweaks that could ...
6
votes
1answer
67 views
3
votes
2answers
730 views
Checking percentage of free memory using top and awk
The following Awk code was created in order to verify if free memory from the top command is less than 20% of the total.
I've noticed that I actually do not need the ...
3
votes
1answer
801 views
Analyse an Nginx access log with awk and produce a report
I'm looking for your opinions on anything that I am doing wrong in the application below, such as best practices, glaringly horrible errors or even just your own personal opinion.
Task: Grab an Nginx ...
7
votes
3answers
7k views
Extracting data from text file in bash using awk, grep, head and tail
I've been writing bash script on and off, with pretty good results in terms of getting the job done. However, I'm worried that my script might be very ugly, as I am a beginner. I'm looking for advice ...
4
votes
2answers
91 views
Filter shell script to find lines that contain all specified patterns
I wrote a script that does the following:
Run another script on the system
Filter the output to find lines that contain ALL of the given patterns
Pipe the output to a second script on the system
I ...
3
votes
1answer
55 views
Extracting performance statistics from FTP session transcript
I've borrowed and written the following code to output the disconnect time. All works well but I'm curious as to how I could tighten/ shorten the code. If anyone feels like having some fun then I'd ...
8
votes
1answer
435 views
Bash script - automate an upload image + description process on a server
I was tasked at work to improve a system where through a web interface a client, which eventually became us, uploads a bunch of images with descriptions (latter coming from csv files), the images are ...
3
votes
2answers
163 views
4
votes
1answer
66 views
Input Columns with Awk
I wrote a small script to manipulate fields of a file based on the input of a user. Is there something I could've done better, or perhaps a better refactor? I do know however that I need a way to ...
6
votes
2answers
154 views
Bash log monitoring
I've made a Bash script to monitor some server log files for certain data and my method probably isn't the most efficient.
One section specifically bugs me is that I have to write a newline to the ...
5
votes
1answer
182 views
Directory's disk usage list
For my classes, I had to finish this task:
Directory's disk usage list
For indicated directory print a list of files and subdirectories in
descending order according to their total disk ...
2
votes
0answers
106 views
Linking input/output states and conditions in an input file
Consider the following CSV file:
A; B; ;
B; ; A;
C; ; E F;
D; ; E;
E; C; ;
The fields:
$1: the jname. A unique id of the entry.
$2: a " "(space)-separated list ...