Questions tagged as 'shell'

3
answers

Executing command with another user inside a shell script

I have a shell script that I need to execute some commands with a linux user, and some other commands with another user. Something like this: #!/bin/bash echo 'rodando com usuário A' comando1 comando2 comando3 echo 'Rodando co...
asked by 23.05.2014 / 21:54
2
answers

Shellscript can not find directory

I'm starting with shellscript, I have to do the checksum of some files, so I decided to automate things with a bash script. I made two scripts, one that uses a ls recursive in the directory set by me and ignores folders by taking only the * ('...
asked by 01.11.2016 / 22:01
3
answers

Prevent the script from following symbolic links

With the script below, a search is made to all the existing properties in the indicated directory in order to obtain the email addresses associated with each hosting: #!/bin/bash # Scan All available email account addresses # for homedir unde...
asked by 22.12.2014 / 13:10
1
answer

Run shellscript on a mobile android [closed]

Does anyone know if there is a default app that reads shellscript on mobile android? Has anyone tried to do something like this?     
asked by 16.05.2014 / 19:14
2
answers

How to get the current path of a .sh script?

On Linux-based systems whenever I need to use the following command: #!/bin/bash BASEDIR=$(dirname "$0") echo $BASEDIR I have however read in different places that $(dirname "$0") is not supported by Mac OS X systems and BSD-based...
asked by 01.08.2016 / 17:51
2
answers

How to get result of selection of menu gdialog in variable in Shell Script?

I'm creating a simple script for learning in which the user should: Type number to be saved in variable NUM1 Enter a second number that will be saved in variable NUM2 Choose from the menu if it wants to add, subtract, multiply or...
asked by 09.03.2017 / 17:56
3
answers

Command to replace characters recursively

I need a command that replaces a specific pattern in each line of a file as many times as necessary until the pattern is no longer found. For example, in a CSV file, the fields are separated by a semicolon ; . Null fields do not have a...
asked by 16.12.2013 / 16:25
3
answers

Delete parts of a Text

Galera is the following I wanted to be able to extract only the user name in a Shell SCRIPT however it has to be mandatory through the text that I inform. I wanted to exactly display on screen only: meucliente From the text: / home / meuclien...
asked by 13.09.2017 / 15:40
1
answer

How can I extract only the PID of a process?

My idea is to create a simple script that can search the PID of a process and kill it for example. This is what I have done so far but has the problem of running 'ps' will not extract the PID. echo "nome do processo : " read $matança ps -ax...
asked by 17.02.2017 / 00:02
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