bash AWK: read the next line getline, the function reads the next line and moves the script to it. I wanted to get the current git version number from https://git-scm.com/downloads, and using getline came very handy by running something like this: curl --silent https://git-scm.com/downloads | awk '/span class="version&
bash BASH: Provide a default value that the user can change I wanted to be able to provide a default value that the user can change in a bash script and found this... read -p "Name to deploy as: " -e -i "gitlab-runner" APP echo ${APP} Note that you need -e for -i to work as intended... And
bash AWK - Display all fields except the last awk 'BEGIN{FS=OFS="-"}{NF--; print}' It's come up a few times where I wanted to get all fields, except for the last one, and I always had to google it, which would take me about 15 min or so to find a
bash How do I check if a port is open from a shell script Sometime I find myself needing to check if a port is open, on a system or container, that doesn't have the usual programs such as, nc or netstat. Luckily, bash have a built in way of checking if a port is open: </dev/tcp/localhost/31339 &