Skip to content
Advertisement

Tag: shell

Run shell script exactly once with cronjob

I have a cron job that calls a script that checks for updates once every hour. If there are updates, it will call update.sh, which in turn calls commands.sh. I would like each “new” commands.sh to be run exactly once. I was thinking of writing to a file each time I run commands.sh with some unique ID of that file.

Merging two files in bash with a twist in shell linux

The following question is somehow tricky but seemingly simple , i need to use bash let us suppose i have 2 text files, the first on is FirstFile.txt SecondFile.txt I want to be able to create a new Thirdfile.txt that contains that values that are not in file A , meaning if there is a common variable with file A

Extract text with any command in linux shell

How do I extract the text from the following text and store it to the variables: Here, I want to store 05 in one variable, 21 in another, 09 in another and so on. All the value must me stored in array or in separate varibles. I have tried: I need a more clear solution or short solution. Answer Your

ignoring variable containing and multiple spaces usnig sed command

I have two variables, i want to replace ESX_10.2.3.4@10.52.33.21 with new pool ser/@10.25.89.322 and also want to remove space before new word. i have tried like, and I don’t want to delete space ,just want to replace as it is(except space before “new”). Answer Give a try to this: It is removing the space in the first occurrence of new

command not found in zsh when it is there

I just installed the android SDK and was trying to run the emulator when this happened: emulator seems to be in one of the $PATH directories, but zsh still says that it wasn’t found. What could be the cause? Answer Solved it. The problem was that emulator was a 32-bit ELF binary, and I didn’t have the 32-bit runtime libraries

How to write shell script,to automate file conversion?

I have 30 files(ascii),which I want convert to binary.Linux command line(FORTRAN 77 CODE) that has been compiled Relevant part of the code Then code asks for input and output file names How to automate this?I have tried like this Or But I do not have a clue for next step.Text files are Output files Answer Try this: The variable op_file

install mysql 5.7 purely from bash script on Ubuntu

I want a bash script that installs a MySQL 5.7 instance without needing any manual input. I was following the tutorial on Digital Ocean and it says for 5.7 you have to run the following commands and then put commands into a prompt (screenshot below). How can I automate the installation if it requires me to use a prompt? Should

Advertisement