Posts by raphaelsalomao3 • 56 points
7 posts
-
0
votes3
answers56
viewsA: Mass collection of information from files
Using the awk, you can set as delimiter the set "-- ". A simple script using your command as an example would be: #!/bin/bash var=$(sudo debugfs -R 'stat <1055890>' /dev/sda1|awk -F': ' -v…
-
0
votes2
answers445
viewsA: Run terminal from Python script
If xterm is installed, the best way to ensure its execution is to pass its absolute path in the subprocess. To find the absolute path: ~ which xterm /usr/bin/xterm Include this in Python Subprocess:…
-
0
votes1
answer31
viewsA: Each round loop var exchange
Use val with your accountant i: eval prev$i=$Produto eval prevdois$i=$Quantidade When i = 1, the above result will be: prev1=$Produto prevdois1=$Quantidade However, although possible to do so, I…
-
2
votes1
answer206
viewsA: Open interactive terminal
You are climbing the container correctly. To open a shell in this container, you need to run a Docker exec: docker exec -it seu-container-mysql bash To disconnect from the terminal, press: Ctrl+p e…
-
0
votes3
answers505
viewsA: Run Mysql command when starting the system
Check your rc.local (if the script needs to be run as root, you have to use sudo manually to run it). Ensure that the /etc/rc.local has execution permission and that the script also has execution…
-
1
votes3
answers102
viewsA: Replace command output with a custom message
You can use an if in your script by discarding the output of the command: #!/bin/bash if openvpn --config srvproxy-udp-1194-config.ovpn >/dev/null 2>&1 ; then echo "Conectado" else echo…
-
1
votes1
answer71
viewsA: Help with script tracing routes
We can work with the Exit Status of your command, which is the value returned by the system call waitpid, and helps us understand if this was successful or not. In this case, we could add the…
shell-scriptanswered raphaelsalomao3 56