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 2 years ago. Improve this question i have file conditions : if the 2nd column is – then 2nd condition check last column value beginning in
Tag: shell
Need a way to check content of file (time data) is more than 5 minutes or not
I am creating a script to pull out the list of highest cpu consuming jobs on my server. I am taking the dump of processes in a flat file in below format: 202009080230,4.1,218579,padaemon,02:30,00:00:01,SD_RCC_FRU:wf_rcc_ds_CRS_FactSuspendedGdc_d.s_m_rcc_ds_Staging_Dimension_FactSuspendedGdc_ipi_d The second data point(4.1) is my cpu utilization while the sixth one is the time taken(00:00:01). I intend to filter out only the entries from this file
how to split a long text file at a particular symbols and pasting the splitted files side by side
Hii experts i want to split a large column of text file at a particular symbol(here >) and want to paste the splitted file side by side as given in a example below: I tried with split -l 4 inputfile > otputfile but it doesnot help.I hope some expert will definitely help me. For example i have data as given
exporting list of variables in docker run
We have a set of variables in env file as given below examples.env Now, docker run cannot substitute $B for /path/path1, due to its limitations So, I want to export the variable in launcher script and then call those variable using -e flag, as given below mydocker.sh Now how to create docker command to get all the variables? Following docker
How to log every single command executed from shell script
I am trying to find a way to record every single command that is executed by any user on the system. Things that I have came across earlier. It is possible to view shell commands executed from the terminal using ~/.bashrc_history file. There is a catch here, It logs only those commands which were executed interactively from bash shell/terminal. This
Show colored output in terminal when using the sh command
color.sh When typing $ ./color.sh the terminal outputs in the respective colors. However, when I type $ sh color.sh it does not output in the correct colors. Instead it gives me the output below. Is there any way to make $ sh color.sh print in the respective colors? Thanks. Answer Use this codes But better use printf Also take a
How to execute command line via input
I’ve read this and this, but didn’t make it work. Here’s my script: and it output things like: Now I’d juste like to execute it in the same line, but xargs makes all incoming into one line of arguments (and it doesn’t run it). xargs -0 doesn’t work either. And I’d like to run it using env -i to run
Using wait-for-it.sh to wait on an endpoint with a slash
Background: I have a project that runs a docker image (in production it will run in knative, but for testing, docker/docker compose is a good first step), and as part of my CI/CD pipeline, I would like to run acceptance tests against the image. I have the image configured to run in docker, and the (cucumber) acceptance tests run as
Tryinf to run existing scripts in shell gives “command not found”
I am trying to install Anaconda with a sh script. I am using Ubuntu 18. Here is my Downloads folder. We can clearly see the script But running it gives a “command not found”. What could be the issue? Answer You can see from the permissions -rw-rw-r– that it is not executable. If you do: then you should see the
Bash regex for same sender and receiver with backreference
I try to make a regex (important that ist a regex because i need it for fail2ban) to match when the receiver and the sender are the same person: What am I doing wrong ? Answer You might use a pattern to match the format of the string between the brackets with a backreference to that capture. Explanation from Match