Skip to content

How to send a message to another user via Bash

I am writing a shell script, and I need to send a message to the other user. If I write write user1 in trem, and then write the message and use Ctrl + D, the message will send to user1’s trem successfully. But I want to use a .sh file to send the message to user1 automatically, and I encountered

jq in shellscript: parse argument with ‘-‘

Here’s the json I need to parse: And my code to parse is like the following: The problem is this part: I can’t get the value of it and I guess the reason is that I didn’t pass $var correctly? I also tried But it doesn’t work..Maybe the tiny ‘-‘ in the “config-$val&#82…

filter file with specift words linux

I have files in which the first column is an ID, and the second column is an option, like this: and I need to create a files with the IDs depending with the option. It is to say: I try with cat file.txt | grep -w “option” > file_option but the problem is that the files are mutually exclusive, a…

Bash script commands not running

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…

Logging python errors on raspberry pi

I’m having a helluva time debugging a python app I’ve written for an embedded raspberry pi project I’m working on because it’s using a TFT screen instead of a full monitor and has no monitor/keyboard, so i’m having to launch the python app via an icon on the TFT desktop (very sma…

Linux command to add a word after a specific line

we need to add the line <property name=”assumeHungTime” value=”600000″ /> after the line <bean id=”DataUnpacker” class=”com-packer” singleton=”false”> in one xml file . Please let me know the command to add it – using sed? Thanks, R…