Skip to content

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…

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…

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.…

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…