Questions tagged as 'bash'

3
answers

Add line at the end of the file with the command sed

I'm setting up a virtual machine to install JDK 7, Tomcat 7, JBoss EAP 7 and Postgresql. Follow the project on GitHub for those who are interested: cresol-enviroment-vagrant . I'm in the part where you need to add JAVA_HOME to the fil...
asked by 14.12.2016 / 19:20
1
answer

Next loop element

I'm trying to implement a commit search algorithm between two tags with the git log tag1...tag2 command. For this I used the command git tag which returns the tags of a repository. With this result, I thought about iterating ove...
asked by 23.11.2018 / 18:47
1
answer

Block comments in bash script

I need to comment on a block of code and found the following way it worked: <<COMENTÁRIO meus comentários aqui... ... COMENTÁRIO I would like to know if this is the correct way to do this, I read it on a website and said that the shel...
asked by 12.09.2018 / 00:45
1
answer

LINUX - how to use a string as a delimiter in the cut command [closed]

How do I use a string in the cut command? already tried with: cut -d"String" -f1 but it says that it is only possible with a single character.     
asked by 05.10.2018 / 13:20
1
answer

Start a virtualenv with .bat file

I have the following .bat cd C:\Users\SERVIDOR-ARQUIVOS\Documents\workspace\email\.venv\Scripts activate.bat cd C:\Users\SERVIDOR-ARQUIVOS\Documents\workspace\email\src python manage.py (comando personalizado) It goes to the folder but clos...
asked by 19.02.2018 / 21:49
2
answers

Script to check if directory is empty

I'm hitting my head to create this script. I need a script, it can be in bash or php itself, it should check if a directory has a file inside it, other than another directory. This directory I have to scan is in linux server that I have he...
asked by 11.01.2018 / 20:23
1
answer

Questions with exercise in Shellscript

I would like some help to resolve these exercises: In the ex4.1.sh script, add the option to enter the word and filename directly from the command line like this: $ ./ex4.1.sh <palavra> <arquivo> In script ex4.1.sh the ou...
asked by 28.03.2017 / 15:03
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
2
answers

Download multiple pages with curl at the same address without overwriting

I need to download this page multiple times, it returns a different result each time it is accessed: i="0" while [ $i -lt 10 ]; do curl -O http://httpbin.org/bytes/128 i=$[$i+1] done But every time the curl command is executed, the...
asked by 28.10.2016 / 23:30
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