I have an issue with executing application via /usr/bin/timeout in a bash script. In this specific case this is a simple python fabric script (fabric version 1.14) In order to install this version of fabric library run: pip install “fabric<2” There is no reproduction with new fabric 2.x. Shell …
Tag: bash
dynamic string search in shell script
I have a string in shell script which is I need to find DS_BLS_max(sequence number).dat here DS_BLS_max(sequence number).dat=DS_BLS_739.dat Answer Output: DS_BLS_739.dat See: The Stack Overflow Regular Expressions FAQ
Rename part of filename using regex
I have a bunch of files where there is additional information in square brackets. I would like to rename them by removing that section. For example: Want to rename to: I tried playing with regex (and using the rename command) but without success. Does anybody know a way to have the rename command strip of onl…
Check the new uploaded file and redirect the file data in other file in bash script?
I have a script to get the mail notification when any new file was created in a directory. Now I want to redirect the data in another file which was uploaded. below is the script which is creating a blank file. Please help. Answer @Yuvi, check tehe content of the $files variable. Does it contain the full path…
How to split a variable with text content on an empty line [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question how can i split a variable with text content by every empty line? Maybe in…
Extract only the in plist using bash in Mac
I want to extract the key value in Countries in the following plist. For example, I want the output file contains the following keys only: But if I use the following script, It will print all the nested element under Countries including: Capital Washington DC Continent North America. How can I modify the scri…
How to build a conditional while statement in Bash?
Hello Stackoverflow community, In order to make my code as less ‘copy-paste-ey’ as possible, I’m trying to come up with a smarter method to make it more compact. Is there any way to create a ‘conditional while’-statement (if that’s even a thing) in your script without havin…
Passing a Command as a Variable to another Program?
I’m creating an interactive script that allows me to plot specific parts of a data file using Gnuplot. These files contain multiple channels of instrumentation data and I’d like to plot specified channels together on the plot. At the moment I can only plot each channel independently with a script.…
Using an environment variable in an rsync argument (dealing with quotes and escape character)
I want to use rsync with an –exclude command that looks like (For some reason it is more handy to me to use such a syntax than using the –exclude-from=FILE syntax) I would like to use an environement variable with rsync so that I could do The problem is that it doesn’t work the way I wish. W…
Can’t restart webmin [status 2]
I’ve updated webmin, but now, it refuse to restart : Can someone explain me what does pam_unix(webmin:auth): authentication failure mean ? some more infos : Thank you 🙂 Answer SOLUTION I tried to start like this The output is a bit more clear, and finally found a solution here. Comment out the lines rel…