Questions tagged as 'bash'

1
answer

How to work with decimals in linux shell, conditional use if & else

I'm working on a code that allows to know the classification of a student through a note entered in shell linux, my problem is that I could not adjust the value to decimal places, if I use the "," the program runs but does not work good. I at...
asked by 01.10.2018 / 20:01
2
answers

Bash to count folders in the current directory excluding others with a given name

In Linux I need to count the number of folders that are contained in the current folder, excluding a pair with these names: $ RECYCLE.BIN and System Volume Information. In total there are 53 files without counting the two that I need to exclu...
asked by 04.10.2018 / 17:24
1
answer

redirect command output to the beginning of a file in bash

I'm doing a network configurator in bash, and I need to add several lines to the /etc/resolv.conf file. Doing echo "hola" » fichero.txt is added to the end, but how do I get it added to the start?     
asked by 06.05.2017 / 13:14
1
answer

error log in bash

I would like to know how I can create a log or have control of the data that is updated or not in this bash script I read a csv and send the data with CURL and the .sh works correctly now I would like to generate a log of errors or have a messag...
asked by 15.11.2018 / 22:04
1
answer

problems when running a shell script, problems in the "if"

Hello, I went to run a shell script in the terminal but I get an error as if I could not accept the condition in the first one (I already gave him the permissions) the exercise says the following: Build a Shell Script called lartc.sh that all...
asked by 27.10.2018 / 22:25
2
answers

bash script with parameters with space

I'm doing a bash script but I have some variables that need spaces like the name, how can I make it so that a space does not take it as another parameter example #!/bin/bash mkdir $1 cp -a /home/x/Descargas/archivo.zip /var/www/html/ unzip /va...
asked by 10.11.2018 / 18:33
1
answer

Save .csv in variable

I try to save a .csv file in a variable like this: variable='archivo.csv' but it gives me an error: file.csv: Command not found     
asked by 24.10.2018 / 13:17
1
answer

Ordered list of names (Bash)

I am trying to use a single command in Bash that allows me to see the contents of a text file in list format and in alphabetical order. The text file contains surnames of several people but they are separated by spaces, and not by lines. Also...
asked by 05.09.2018 / 16:32
1
answer

Bash autocomplete

I am creating an interactive menu in Bash where I want to be writing a text entry, at the same time read a file.txt and with that information show us options to autocomplete our input, something like the autocomplete in jquery. The question is:...
asked by 03.09.2018 / 18:03
1
answer

When executing a remote command by ssh the variable is cropped

I want to execute the following command from a script. public_ley contains a public key that starts with ssh-rsa AAAAB3NzaC1yc2, but when the ssh I execute the command does not pass all the content of the variable, as if I made a trim and onl...
asked by 28.08.2018 / 23:10