I have two scripts, one to run the application shutdown for Tomcat server, and another that calls it when deploying. So basically after Jenkins builds my application, and moves the deploy-able artifact to the server (linux). Once that completes Jenkins kicks off a script to do the deployment of the applicatio…
Tag: bash
Bash inline version of piping file to bluetoothctl
bt.sh If I pipe the above file to bluetoothctl, it works as expected. But how can I do that as an inline script, I have tried the following but it does not work and bluetoothctl does not appear to register the commands: Answer Use a command list:
Printing awk output in same line after grep
I have a very crude script getinfo.sh that gets me information from all files with name FILENAME1 and FILENAME2 in all subfolders and the path of the subfolder. The awk result should only pick the nth line from FILENAME2 if the script is called with “getinfo.sh n”. I want all the info printed in o…
Replace variable in text file with another variable
I am trying to write a variable to a specific spot in a text file. So far I have the variable generation part done, but when I open the text file to see the result, the ${at} placeholder has been replaced with ${assetTag} and not the value of the variable. So the idea is that I compare the $serialNum to
bash script to kill a python script after starting another same python script
I start a python script and then after some time i want to kill it. but before killing it I want to start another copy of this same script and then kill the previous one after starting new one. I want to do this in loop. here is my code , i just need a clean way to kill scripts.I
Bash output all links in following format [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 4 years ago. Improve this question i wan…
Interleave lines sorted by a column
(Similar to How to interleave lines from two text files but for a single input. Also similar to Sort lines by group and column but interleaving or randomizing versus sorting.) I have a set of systems and tasks in two columns, SYSTEM,TASK: I want to distribute the tasks to each system in a balanced way. The id…
changing two lines of a text file
I have a bash script which gets a text file as input and takes two parameters (Line N° one and line N° two), then changes both lines with each other in the text. Here is the code: It works fine for every two lines which are not consecutive. but for lines which follows after each other (for ex line 5
Bash for loop with Parenthesis working in linux and not in Git Bash
i have simple bash loop which is working fine in linux and not in local Git Bash which based on cygwin in windows i have this for loop : in Git Bash it gives me this error : linux version of bash Amazon Linux version 20xx.0x is available. [user1 ~]$ bash –version GNU bash, version 4.2.46(2)-release (x86…
Why does zsh not autocomplete custom created scripts when bash does?
I have a custom created script to change my apt sources in /home/USERNAME/Scripts. I have added this path to the secure_path variable in /etc/sudoers. When I use bash to run my script as sudo it autocompletes just fine, but when using zsh it does not. Answer Because zsh doesn’t have autocompletion witho…