Questions tagged as 'bash'

1
answer

How to create a build script to compile librtmp with openssl?

I'm implementing the ijkplayer project android mediaplayer but I'm having trouble adapting an automated build of librtmp ( rtmpdump ). I have the following example, used to compile OpenSSL in ijkplayer: ijkplayer / android / contrib / t...
asked by 17.06.2016 / 02:38
2
answers

PHP running PYTHON

I'm trying to run a python script through php, but it does not run python. I used the code to test: $cmdResult = shell_exec("ls & /usr/local/bin/python2.7 --version & echo done"); Returned: done LICENSE example.py When I typ...
asked by 25.07.2016 / 21:39
1
answer

How to do 'Loop' in multidimensional 'Array' in Bash?

Situation: I need to create a multidimensional array script. Example: Table 1 > > Fields id and name Table 2 > > id and phone fields Current script: #!/bin/bash declare -A arr arr[tabela1]=id arr[tabela...
asked by 08.09.2015 / 16:26
2
answers

How to create a shell script that puts an echo at the beginning of each line in a file

I need to create a script that inserts the echo command at the beginning of each line of the file and at the end > > blocodenotas, for example #!/bin/bash ls -l uname -a netstat -tunap I want a script that turns this into: echo "#!/...
asked by 13.12.2018 / 20:39
1
answer

I can not identify the error in my script

if [ $# -eq 1 ] then$atletas=$(find treinos -maxdepth 1 -mindepth 1 -type d) for a in $atletas do dados=$(find $a -mindepth 1 -maxdepth 1 -type f -name "????-??-??.txt") nome=$(echo $a | cut -f2...
asked by 01.12.2018 / 19:33
2
answers

How to get exit code from a command block

Suppose I have the following commands in a script susd systemctl status firewalld If I look at exit code through echo $? it returns 0 because the last command was executed successfully, but how can I get the exit code o...
asked by 03.08.2018 / 01:18
1
answer

Authentication error when sending file to repository in Github

Well, I followed the steps in this link , but when I arrive in git push -u origin master it asks the git user and password in a windows forms, then asks the user (2 line), and asks for the SSH password, and I did not even set this passwo...
asked by 26.07.2018 / 20:41
1
answer

Why nohup does not accept for loop?

I have this code inside a file called test.sh When I try to run nohup ./teste.sh &  he gives this error. Can anyone explain me? ./ teste.sh: 9: ./teste.sh: Syntax error: Bad for loop variable CODE cuda="cuda.out"; cpu="cpu.out"; cuda...
asked by 16.06.2018 / 19:10
1
answer

Script to check process running and finalizing or not

I have a process called monitor.exe and it can not have 2 active processes because it is a print monitor that if it has 2 active processes it will issue 2 duplicate invoices, so I would like to know if it has how do I make a script that checks i...
asked by 19.04.2018 / 15:01
1
answer

Put flag at bash shell command line

I'm trying to put a flag that can sort or shuffle the output, but I could only do that in code and intended it to work when I put the flag on the command to run the file, for example ./bash.sh -r .     
asked by 02.01.2018 / 22:34