Category "bash"

CyberArk ITATS004E Authentication failure for User in python script

I'm trying to implement a python script that executes local bash scripts or simple commands on remote CyberArk machines. Here is my code: if __name__ == '__main

Perl backticks using bash

In Perl, the default shell to execute backticks is sh. I'd like to switch to use bash for its richer syntax. So far I found that the suggested solution is `bash

Is there a way to get my laptop to beep from within a bash script running on a remote server via SSH?

I have a bash script that I have to regularly run on a remote server. Part of the script includes running a backup which takes a while, and after it has run, I

Log in to a site (Stack Overflow) by Bash

How can I log in to a website using Bash in Linux? For example, to log in to Stack Overflow I tried many different methods, shown below, but nothing's worked. w

Grep exclude count of occurence match between comments <!-- --> of curl body

I am very new to linux & bash script. I'm trying to read an xml file using curl command and count the number of occurrence of the word </entity> in it

Bash script for loop not exiting when command is successful

I have the following script #!/bin/bash echo '' maxTryTimes=10 for ((i=1; i <= maxTryTimes ; i++)); do echo "try setup mongodb replica ${i} ..." m

using python variables with bash magic in jupyter

I would like to run bash commands in jupyter notebook using the %%bash magic command and pass python variables. As described in this post I can do this as follo

How to make the ssh with -o StrictHostKeyChecking=no running on the docker in order to ssh the host work without exiting the script execution?

I have a script, that is running inside the docker container some actions we need for some internal debugging purposes: set -eu echo "Starting i/o test for hos

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