All Questions
4 questions
0
votes
0
answers
51
views
How to run a process in the background using a bash script? [duplicate]
When I run the command in the terminal: sudo badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:8080 I get a terminal with packet data ...
3
votes
2
answers
808
views
How to propagate an error code outside a terminal?
From inside a bash script I try to retrieve the error code of a program launched in a new terminal window. It can be reduced to this:
#!/bin/bash
urxvt -e bash -c "exit 4"
echo $?
output: 0
I would ...
-1
votes
2
answers
684
views
how to get Ip add of ssh user who is currently running a specific process?
An ssh server has a process that is started by a user who is logged in through ssh. I need to find a way to get the IP address of this user who executed a specific program "chrome for example" through ...
5
votes
3
answers
4k
views
Get the terminal emulator name inside the shell script
I have used pstree to find the name of the parent emulator of running shell script using something similar to the following:
pstree -s $PPID | awk -F '---' '{print $6}'
This works in my current ...