Questions tagged as 'shell'

2
answers

Problem with Syntax IF Shell Script

I have the following code: RESPOSTA=$(asterisk -rx "sip show peers" |grep 4003 |awk -F" " '{print $6}') if[["$RESPOSTA" == "OK"]];then echo $RESPOSTA elif[["$RESPOSTA" == "Unmonitored"]];then if[["$RESPOSTA" == "(Unspecified)"]]; then cp /...
asked by 05.08.2014 / 16:55
3
answers

Send PHP variable to Shell Script

I have a .sh file and it has variables that I need to get from PHP, here's an example: //variavel 1 que preciso receber externamente NAME="" //variavel 2 que preciso receber externamente DIR="" tar -zcf $HOME.tar.gz $DIR Calling the...
asked by 29.07.2016 / 20:44
1
answer

How to remove an alias in bash?

In bash, how to remove an alias? For example, after doing alias man="man -a" , I just want to execute man instead of man -a .     
asked by 09.06.2015 / 15:05
1
answer

CMD, Console, MS-DOS and related terms

Well, it has embarrassed all the concepts that I will list below, and I would like to see the definition of these terms presented, perhaps some are synonymous with others and others are totally different. SHELL BASH Terminal Console...
asked by 06.07.2015 / 05:33
1
answer

Command to delete all but the most recent three folders

On my application server, I'd like to keep a history of my releases. However, I do not want to keep all of them, because we rarely have to do rollback for very old releases. So I'd like to know which command to delete all but the latest three...
asked by 03.09.2015 / 16:32
2
answers

Copy directory from one ssh server to another

I need to copy a directory to a server with a script .sh running on another server. I read about the scp command and I saw some usage examples, but I did not figure out how I put the password of the server I'm accessing to copy r...
asked by 05.08.2016 / 14:56
4
answers

Variable interpolation in shell script that returns the output of a function

I've solved a problem with a larger script I'm producing. Basically I have a function that returns the current date and time in a specific format. I need every time the variable data_hora is printed on the screen, its values are updated f...
asked by 28.12.2015 / 03:43
1
answer

Shell script function

I have a VM and need to run a script remotely in another VM, for example: Script is in VM X and must be executed by X in VM Y. #!/bin/bash IP=$1 if [ $# -ne 1 ]; then echo "informe o servidor $1: " exit fi for machine in $1; do ssh...
asked by 08.02.2016 / 17:05
1
answer

Regular expressions with 'grep'

I need to extract data from a text and I'm trying to do this using grep. But the way to make use of regular expressions with this command are quite different from what is usually done in Ruby or JavaScript, and I am not able to do what I need. I...
asked by 02.04.2015 / 23:13
1
answer

Diff changing rows

I'm comparing two files, which are updated daily, with the diff -y command in order to get two results: The first are the lines that have been modified from one day to the next: grupoAzul;Gabriel;04-maçãs;02-limões | grupoAz...
asked by 31.07.2018 / 17:58