Questions tagged as 'bash'

3
answers

Bash - Save errors in a variable

I am running a bash script that saves the error messages in a .txt log file, I need to save the error messages in a variable now, following example: LOG="/home/control/log.txt" exec 2>>$LOG tar -zcf teste.tar.gz teste It zips the test...
asked by 20.07.2016 / 22:48
2
answers

Linux runtime

I need to take the average run time and CPU de 30 execuções consumption of a program done in Python . I have to use the command time of Linux . Since I've never worked with Linux before I'm having trouble doing t...
asked by 03.06.2015 / 21:15
1
answer

add user to sudoers group on Ubuntu [closed]

How to create a user and put it in the list of sudoers in linux? How to get an existing user and change your group to sudoer?     
asked by 28.10.2014 / 22:28
1
answer

How to identify percentage of memory usage to perform cache cleanup command?

We know that the memory cache cleanup command is this: sync; echo 3 > /proc/sys/vm/drop_caches But how to make an executable with an if () else () condition, so that this command only runs when memory usage reaches 80% or more through cr...
asked by 15.10.2014 / 01:27
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

How to reset the Ubuntu bash password of windows 10? [closed]

I do not remember the password of my Ubuntu bash user on Windows 10 how do I create a new password for my user?     
asked by 19.06.2018 / 16:33
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
1
answer

How to do a git push to bitbucket programmatically using BASH in Ubuntu16.04?

I have a bash script running on ubuntu 16.04 whose goal is to create a laravel project and then create that same repository on bitbucket and then push content to the repository just created on bitbucket. The only part that is missing is the p...
asked by 23.03.2018 / 15:37
1
answer

Editing file with links in shell script

I have a file with 130 links to make downloads via wget , all files are with links listed such as: http://minhateca.com.br/Animesdojonny/Desenhos/THUNDERCATS/Thundercats+-+Completo/Thundercats-EP001,743727846.rar http://minhateca.com.br/...
asked by 29.03.2018 / 01:06
1
answer

How to open and close a browser window programmatically using bash commands in ubuntu 16.04?

I have a bash code that, at the end of some installations, should automatically open a browser window with a URL (myapp.com) passed as a parameter. A php configuration page is displayed, confirming that everything has been installed correctly an...
asked by 26.12.2017 / 22:03