Questions tagged as 'shell'

2
answers

how to get a process launched from a script not to die when the script ends?

I'm trying to launch a dbus client, programmed using a Python script, from another script launched using a udev rule (which runs as root), and I need this dbus client to remain running when the script ends. The dbus client to launch is: #!/...
asked by 26.03.2018 / 19:18
2
answers

Problem running crontab every two minutes using the root user

I have a very simple .sh file: echo "\nhola" >> /etc/holaadd.txt I just run it and add a line ... my problem is that I want to add it to: /etc/crontab directly and I added it in the following way: */2 * * * * root /bi...
asked by 23.09.2016 / 00:22
2
answers

Correct handling of pointers

I'm having problems performing implementations of some of the shell commands in C. From my point of view it seems that it is due to an incorrect handling of pointers in C (I have not learned this language for a short time). At the moment I am tr...
asked by 28.11.2016 / 00:10
2
answers

Connexion to a server via ssh

I want to know how I can connect to a server via SSH putting all the data ( user , host , password ) in script .sh , I need this script .sh to be executed automatically by cron and that this access a database on t...
asked by 24.11.2016 / 17:30
2
answers

Set up a linux script to run with the permissions of another user

My specific need is the following: A script of usuario1 has to be able to be executed by any user of group1 (that I know how to do), but when it is executed it has to have the permissions of user1. It would be something equivalent t...
asked by 04.08.2017 / 14:05
1
answer

Comment a line in a file.log

Good, I have the following code: !/bin/bash while read line; do echo "$line"; if[???????] fi done < /home/javi.log javi.log file: # javi_2223 javi55_555 imp33 imp44 javi32423 javi5646 I want the script to comment...
asked by 19.12.2018 / 19:21
1
answer

Read and assign value to the result of a command

I have the following script nmap_result=$(sudo nmap -sP 192.168.0.1/24) own_ip=$(ifconfig wlp2s0b1 | grep inet | awk '{print $2}' | cut -d':' -f2) temp_mac=$(echo "$nmap_result" | grep "MAC Address:" | awk '{print $3;}') temp_ip=$(echo "$nmap...
asked by 13.04.2016 / 00:56
1
answer

Problem with shell script on Mac (osascript dialogs)

I am creating a script to delete some files (my purpose is to learn to use the dialogs and execute some tasks), I was forming it based on examples in the network, the dialogs work well, except when I want to execute the commands sudo , tel...
asked by 18.09.2017 / 18:10
1
answer

Run crontab using "notify"

I explain the problem a bit above, but basically that's it. I want to add a script in crontab that runs every minute. The script, on the other hand, should show a simple greeting message. He has no more. Chrontab line: * * * * * sh /tmp/not...
asked by 17.05.2016 / 13:04
2
answers

Restart Mysql before the maximum connections arrive

I have a MySQL DB running on a Debian machine in GCP, which sometimes reaches the limit of connections, which leaves the application stopped until it is restarted and then the application can be reconnected. Currently has a maximum number of...
asked by 12.12.2018 / 15:44