Questions tagged as 'shell'

1
answer

How to get the runtime of a program with shell script?

I am creating a basic script in which I would like to get the runtime of a program each time it is called in the script. #!/bin/bash for i in {1..15} do echo "Execucao $i" time ./meu_programa > resultados_nesse_arquivo.txt done But wh...
asked by 04.03.2018 / 17:51
1
answer

Error in parameter passing to a Shell Script

I'm creating a script to get some images in the folder and with this generate another image, I'm using Imagemagick, but the problem I'm having is in passing one of the parameters of this script I'm putting together and gives me this error: mon...
asked by 25.01.2017 / 04:08
1
answer

Creating new users through Shell Script

I'm trying to create a shell script to add new users to the GNU / Linux system But without entering native commands like adduser or useradd in the script, it would be something on the nail. I'm with something almost fine (ready!), bu...
asked by 19.12.2016 / 02:48
1
answer

script called once, but turns two processes

I have here a script to test a background function. When squeeze is launched two processes and I do not understand why. One stops at "sleep 20", and the other runs forever. #!/bin/bash back(){ n=0 while [ 1 ] do...
asked by 23.09.2016 / 10:41
1
answer

Force a shell script to run in the terminal

   The user will download the script from an internal site and run it. What I wanted was that after the download the user gives two clicks on the script and it runs and does not open for editing. Is there a way to force a script shell...
asked by 21.12.2018 / 18:53
1
answer

How can I turn "to" into a bash script

I made a small script in Python that transformed a .py file into a bash Linux script, however, the quotes that are inside the Python file end up making the script not work. Is there any way I can transform all% of a text in bash to "...
asked by 02.12.2018 / 12:23
1
answer

Something like GetAsyncKeyState () for Linux systems, is there something similar?

I searched a lot on the internet and could not find something like GetAsyncKeyState () that is not in the windows.h library. Is there a library or some way forward that allows "direct" control of things like knowing if a key is being pressed, or...
asked by 31.05.2018 / 00:47
1
answer

How to run Shell Using PHP using the bash compiler

I would like to know how to run PHP in Shell using Bash . I tried this way but it made an error: #/usr/bin/php <?php echo 'Olá Mundo'; ?>     
asked by 03.05.2018 / 04:44
2
answers

Shell Bash, How to pass data from shel as parameter

I need to run a file1.sh file, but I also need to get the data that comes after it, for example: file1.sh 171.55.8.45, that ip that comes after, on the same line as the file, before pressing enter , I need this ip to be read and passed as a para...
asked by 15.12.2017 / 13:43
1
answer

Crontab does not execute script

I'm trying to run a script through centos crontab, I'm doing this: crontab -e Then I put: */1 * * * * root /home/websites/public_html/admin/functions/open.sh obs: Before doing this, add permissions to the file chmod +x open.sh I'm...
asked by 10.07.2017 / 17:13