Skip to content

Tag: shell

How to make rsync read SRC from STDIN?

I want to dump my MySQL database and make daily backups with rsync. First approach I came up with is something like mysqldump -ufoo -pbar baz > /var/tmp/baz.sql && rsync /var/tmp/baz.sql /backup/ && rm /var/tmp/baz.sql. Then I started to wonder if it is possible not to use the temporary fil…

comparing two files with different columns

i have the two files(count.txt, count1.txt). i need to do the following 1. get the values from count.txt and count1.txt where 1st column is equal. 2. if its equal need to compare the 2nd column like ((1st column value + 5) >= 2 column value) count.txt order1,150 order2,165 order3,125 count1.txt order1,155 …

Bash script processing limited number of commands in parallel

I have a bash script that looks like this: But processing each line until the command is finished then moving to the next one is very time consuming, I want to process for instance 20 lines at once then when they’re finished another 20 lines are processed. I thought of wget LINK1 >/dev/null 2>&amp…

How to start java program with hidden terminal

How can i create shell script for linux, Which will start my java program and then exit itself Like:- create new process with no terminal-> java “Test”. exit terminal itself. i have tried with Fork and exec but i couldn’t get any of it please help me Answer I solved this by using Python s…