Posts by Dankərnl • 41 points
4 posts
-
1
votes4
answers9489
viewsA: How to call a new terminal from a shell script?
good night! You don’t necessarily need another terminal, you can run multiple scripts at the same time. Create the two script files, in the example I will inform as if it were index.sh and…
-
2
votes2
answers205
viewsA: How to pass command result to a bash variable?
Another way is to use awk as well resl=$(awk -F: '{print $1,$2,$3}' frutas.txt) #-F: determina que o separador seja ':' And to pick up specific lines: resl=$(awk -F: '{if(NR==1)print $1,$2,$3}'…
-
1
votes2
answers740
viewsA: Shell Script - insert variable in a command
I don’t know if I understood correctly, but if input is needed I could use read. #!/bin/bash read -p "Input: " input # A opção -p faz com que possa digitar na mesma linha echo "${input}" # Utilizar…
-
0
votes3
answers3774
viewsA: Write text to Shell Script
You can use exec: #!/bin/bash exec 1>> text.txt #Echos echo "foo" echo "bar"