I have seafile (http://www.seafile.com/en/home/) running on my NAS and I set up a cron tab that runs a script every few minutes to check if the seafile server is up, and if not, it will start it The script looks like this: running /home/simon/seafile/seafile-server-latest/seafile.sh start and /home/simon/seaf…
Tag: bash
Remove only Alphabetic Character lines in a linux file by using Sed/Awk
I have a linux file. In that file, some lines are there merge as with numeric and alpha charcters. I want to remove only alpha characters lines.. Let us consider a file with the sample contents as below: remove only #Terry Kalkas Lans Road, Beaver Falls PA kind of lines. I want to see Please share your Ideas …
How to send facebook message from linux console (command-line)
Old days many admins use sms-gates for sending important informations from their systems e.g. “Power down, UPS is working now!”, “Power Up, UPS is off!” or “CPU Temp too high!”. Today in Facebook era we use messenger instead of SMS, so I wonder if I could create a command-l…
Until Loop not working as expected
I’m currently learning Linux and as an homework, we have to create a few basic shell scripts. Nothing especially complicated but this one is giving me headaches. Here’s my code : Basically, I have another script called afficher.sh (I’m french so don’t mind the french language used) and…
list file key-pair sorted by time
I need to sort a filename pair sorted by time. Every file starts with AUSZUG or UMSATZ (and some numbers after). But the problem is that I cannot sort it by just time because some files can be uploaded (created) not as pair. For example, default sort: You can see, UMSATZ pair for AUSZUG_5785745789.TXT.GPG are…
how do I limit the number of history items in bash? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
Obtaining file names from directory in Bash
I am trying to create a zsh script to test my project. The teacher supplied us with some input files and expected output files. I need to diff the output files from myExecutable with the expected output files. Question: Does $iF contain a string in the following code or some kind of bash reference to the file…
how to execute init scripts from the command line using ssh
Above mentioned code works fine and displays all the contents of the test directory folder but this code fails It does not start the mysql server, I have login in to server and use the same command to start the mysql server Can any one explain this behaviour ? what I am doing wrong bit puzzled 🙁 Answer Do som…
Make a variable containing all digits from the stdout of the command run directly before it
I am trying to make a bash shell script that launches some jobs on a queuing system. After a job is launched, the launch command prints the job-id to the stdout, which I would like to ‘trap’ and then use in the next command. The job-id digits are the only digits in the stdout message. and then I w…
How to get the lines in one file which contain a string(with repetition) in another file?
File 1: File 2: My desired output: I am trying to implement this using bash or Python. In python I tried: In bash I tried: But this does not consider repetitions. It will give the output Any ideas? Answer Here’s one way you could do it using awk: Read the key-value pairs from the second file into the ar…