Category "bash"

Exectuting Mininet CLI command in Xterm Window

I have a topology in which the h4 is the receiver and rest of the hosts are senders.I am executing a bash script on the h4 which returns the ip of one of the ho

Parse Text with "awk" and Modify One Of The Columns With "sed"

I have a data seperated with pipe "|" and I would like to parse it with awk and write it into a DB. EndpointRequest|ID-ip-172-31-70-119-eu-west-1-compute-intern

Trying to call a function within a function in Bash but it returns errors

I had looked on overflow and exchange, but I can't seem to find an answer for this. I am currently trying to make a recursive fibonacci function. However when I

grep for a pattern "variable=value" and returning only matching entries having a value > threshold

I am searching a kubernetes pod logs for the pattern “variable=value” ( e.g., variable=10 or variable=500) using the command below: Kubectl logs -f

How can kill all the processes triggered by hotkey with some smart way?

I want to kill a process and its son process with trap command: vim waiting.sh trap "kill $$" EXIT sleep 10000 Now run it in background: debian@debian:~$ b

Why does line comment tricks for bash not work with exclamation mark "!"

ref Inline comments for Bash? We can use this tricks echo abc `#put your comment here` \ def `#another chance for a comment` \ xyz etc but these d

how to autoinput in bash scripting

I'm tired to put username in this input by bash script i run the script but what shall i do when i rich to this line its expecting to input username Vpn.sh: 1:

how to autoinput in bash scripting

I'm tired to put username in this input by bash script i run the script but what shall i do when i rich to this line its expecting to input username Vpn.sh: 1:

grep positive/negative integer value only

I am looking to grep any positive/negative integers only and no decimals, or any other variation including a number. I have a testpart1.txt which has: This is a

How to get latest file from sftp server to local using mget in linux?

Hi I am following below logic to get the latest file from sftp server. But it is copying all the files. Please help what I need to correct in my logic? datadir=

delete kubernetes pods which status shows 'CrashLoopBackOff' via shell script

I trying to write a script to delete pods status CrashLoopBackOff from all namespaces. #!/bin/bash # This script is basically check all avialble namespaces # a

BASH: Filter list of files by return value of another command

I have series of directories with (mostly) video files in them, say test1 1.mpg 2.avi 3.mpeg junk.sh test2 123.avi 432.avi 432.srt test3 asdf.m

Flickr camera roll backup with wget or curl

How can I backup the camera roll page in flickr with wget or curl as a static page? #!/bin/bash cookies=/Users/xxx/Downloads/flickr/cookies.txt root="https://w

Execute Openwrt UCI add_list through ubus call

I am trying to add a new interface to the network.lan.ifname using the "ubus call uci add_list .." The syntax used to run it directly is (which is working): u

Git alias for checkout branch, pull and checkout back

We are using the Feature-Branch-Workflow, which means others merge theire changes to the dev-branch that I want to merge into my feature branch. As it happens a

AWK return/print as associative arrays in Bash

With this command I am trying to filter through my firewall. In order to extract the firewall rule ID number and the IP address. existing=($(ufw status numbered

How schedule crontab job when using pyenv and pipenv

I'm on Ubuntu 20.04, and I am having issues setting up the crontab correctly using pyenv + pipenv together. Simply adding pipenv run python script.py to the cro

JQ map objects to array

I have this input data: [ { "attributes": { "created": "2021-10-18T12:02:39+00:00", "enabled": true, "expires": null, "notBefore":

How schedule crontab job when using pyenv and pipenv

I'm on Ubuntu 20.04, and I am having issues setting up the crontab correctly using pyenv + pipenv together. Simply adding pipenv run python script.py to the cro

How to keep dollar sign within sed in the bash script?

I am trying to find a way to escape the dollar sign within the sed command in a bash script. I have found here tons of answers that say that you need to put fou