Questions tagged as 'shell-script'

2
answers

How to debug shell script in linux?

I'm new to linux, and I'm learning shell script and my question is as follows. When I want to debug something in PHP, for example, I put a breakpoint in the code and run the same with debug on, I wanted to know how can I do this with a shel...
asked by 28.02.2017 / 03:52
3
answers

What are [] in bash?

I'm starting in shell script now, and often reading other people's programs, I see the use of [] associated with if . For example: if [condition]; then fi I have also often seen use as follows: if [[condition]]; then fi...
asked by 30.08.2016 / 21:49
1
answer

What is a unary operator

Code: #!/bin/bash echo "Digite 1:" read$TESTE if [ $TESTE == 654 ] then echo "Usage: ./pingscript.sh [network]" echo "example: ./pingscript.sh 192.168.20" fi Error message: Digite 1: 321 ./z.sh: linha 5: [: ==: esperado opera...
asked by 29.04.2017 / 22:01
1
answer

Graph of total connections per second during a denial of service attack

I have a network dump (PCAP file) containing slowloris attacks: ThefollowingscriptwillshowthenumberofconnectionspersecondtoIP192.168.1.2onport80:tcpdump-qns0-A-r1.pcaphost192.168.91.5andport80|sed-une's/^\(.\{8\}\).*IP\(.*\)\.[0-9]\+>192.168...
asked by 24.05.2017 / 16:25
2
answers

linux command - block rename / rename folder

I need to give an ftp user access to the / var / www folder but there are folders that it can not access / edit / delete I tried a command: #chmod 000 <pasta>     
asked by 10.04.2015 / 15:02
2
answers

Hide error messages

Consider the following shell script: ping 8.asd.8.8 -c1 -q > /dev/null if [ $? == 0 ] then echo 'ok' else echo 'erro' fi This ping will return an error and this error is handled in else just below. But even using the -q pa...
asked by 16.09.2016 / 02:24
3
answers

How to call a new terminal from a shell script?

I would like to know how to call a new terminal / xterm from within a command in the shell script, so that the shell script that called the other script continues running non-stop. Does anyone have any suggestions?     
asked by 16.01.2015 / 18:30
1
answer

Transform string into array Shell Script

I'm trying to make a script to backup my database. But I wanted to not need to provide the bases name when I run the script, but save each base in a different file. My script looks like this: #!/bin/bash BASES= mysql -u *** -p"***" -B -...
asked by 27.01.2017 / 11:23
1
answer

How to identify in a shell script, which is the docker command that is running

I've created this image ( link ) that sets up an environment for an application social networking website. This application needs a link with a Mysql container. In the Dockerfile of my image ( link ) exists a RUN command with a shell scrip...
asked by 10.12.2015 / 20:01
2
answers

How to include code in Shell Script files

How can I perform the following process: Add arquivoa.sh and arquivob.sh into arquivoc.sh , and then execute the functions defined within each file filea.sh #!/bin/bash echo "Arquivo A" function funcaoA(){ echo "Ex...
asked by 24.03.2017 / 16:20