Questions tagged as 'bash'

2
answers

Delete character in a certain position?

How do I delete a particular character in a particular position in the shell? I've tried with sed , but I can not put the position too, just the default. ",45123","B23142DHAS675" What I wanted was to delete the , that is in...
asked by 30.04.2014 / 21:24
1
answer

Shell send error message

I have a cron job running that calls a shell script. This sh file backs up the database and saves it to a folder on the server. That's working. I know that at the time of generating the backup and / or save an error may occur. I would like to...
asked by 26.02.2014 / 19:50
1
answer

How to use acute accent inside a string in a bash script?

I use the script below to download audios from google translator for use in a personal program that tracks codes and quantities from my stock. The problem is that the acute "oh" accent of the word code is bringing a faulty audio, as if it were e...
asked by 31.03.2015 / 13:50
1
answer

How to calculate the download time of a website using wget?

I'm working on a project where I need to calculate the loading time of a webpage for optimization purposes. I'm using this command:    $ time wget -H -p --delete-after melga.com 2 & / dev / null But I'm not sure if the access time...
asked by 29.04.2016 / 16:32
1
answer

Problem with 'echo -e'

I'm starting to learn shell script and am doing some simple scripts to train. The script below tests whether anyone running the script is logged in as root. # !/bin/bash # # This script test if you are the superuser if [ "$(id -u)" = "0" ];...
asked by 14.08.2014 / 01:45
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
3
answers

Extract information from a .txt file

I have a .txt file with the following information. 31.812:9.862 179.52:6.847 315.015:9.135 462.305:6.276 103.875:4.122 176.064:3.593 196.7:4.407 246.599:4.423 I need to extract this information 9.862 6.847 9.135 6.276 4.122 3.593 4.407 4...
asked by 25.01.2017 / 19:23
2
answers

Git bash does not accept the paste command

I would like to know why git bash does not accept the ctrl + V command. Every time I have to clone a repository in github I have to type the entire url!     
asked by 27.07.2017 / 17:42
2
answers

How to compare the value of a variable with a string in the shell script

Well, I'm trying to make a comparison like this but bash is interpreting it as a command if "$V1" = "sim" then ... How do I compare the value of V1 with the string "yes":     
asked by 03.07.2018 / 21:54
3
answers

Check if a process is not running and then run it

I need to run a given command via terminal. However, this command should only be run if the process is not running. If it is running, you do not need to do any other operation. How to do this in linux?     
asked by 18.01.2016 / 17:35