Questions tagged as 'bash'

3
answers

Replace a line in a bash script file

The situation is as follows, I have 3 variables available: numlinha - > line number to replace texto - > text of the line to be replaced (I would prefer to use the line number but this is here if I can) texto_sub...
asked by 04.10.2018 / 21:05
1
answer

How to dynamically insert a DNS in / etc / hosts through a bash script?

I have a bash runmydocker.sh script whose purpose is to retrieve the string sent by the user when he is calling that script and create a DNS in etc/hosts . Example: The user (developer) will call runmydocker.sh mysitephp7.com...
asked by 20.11.2017 / 21:55
1
answer

Write output from bash linux, in a file

I need to do some testing on the linux command line, but doing all the testing is very time-consuming, can anyone help me, if I can, write code in shell script to run all tests, and write output from bash in a txt file?     
asked by 27.10.2017 / 18:08
2
answers

Check empty directories and catch command output

I have a folder called work and inside it I have 2 folders: p1 and p2 . How can I tell if the p1 and p2 folders are empty? I have the following command find . -type f -printf "%T@ %p\n" | sort -nr | cut -d\...
asked by 24.11.2017 / 17:29
1
answer

libav - save (segmented) stream capture with timestamp in filename

I was looking on the internet how to make a homemade DVR (using a Linux machine) and what I found was this avconv command: avconv -i rtsp://<user>:<password>@xxx.xxx.xxx.xxx:xxx/play1.sdp -c copy -map 0 -f segment -segment_time 300...
asked by 12.08.2017 / 10:17
1
answer

Slow bash script

I use a bash script to translate words from other languages into Portuguese. It always worked very well, but for a few days it got extremely slow, to the point that I could not use it. Home some people informed me that the problem could be in th...
asked by 16.09.2017 / 02:49
1
answer

Bash alias with parameters

I'm creating a system that works online, the user logs in and will have access to a terminal which can execute only the commands allowed on the server. The question is this: The user will have to execute a script in Python and pass parameters...
asked by 02.08.2017 / 09:22
1
answer

Bash program does not display data output

Good afternoon, I'm programming in C and it's the first time I'm programming in Bash (shell-script). I did some bash functions, learned to call and created an interactive menu with the user, my program does "basically" reading a wordlist a...
asked by 26.12.2016 / 17:08
1
answer

In bash, what is the difference between a null string and an empty string?

I would like to know if there is a difference in how bash represents variables with null values var= and with empty strings var="" What precautions should I take when handling variables like these?     
asked by 24.12.2016 / 20:33
1
answer

Root permission to change date and time [closed]

I would like to know how I can get my script to change system date and time without asking to enter the root password?     
asked by 22.11.2016 / 23:32