Questions tagged as 'shell'

2
answers

Script or command to add all directories and show the total size

My question is as follows, I am developing a script where from a text list where you will have the name of the directories, the script pick up the name of each directory, show the size of each directory and then the total. Example: I need to...
asked by 31.07.2015 / 01:07
1
answer

Define multiple variables in just one row

I would like to make a parser with just one line and break a string into several variables. In the string I will parse, the default is that each field is separated by a comma. On several lines, the code to do what I want would be like this:...
asked by 03.03.2014 / 18:49
1
answer

Mongo find array in collection

Good people, this is my output with the normal find: { "_id" : ObjectId("57be6168ce98ad853a96282f"), "nome" : "Mercado Padrão", "userId" : "o4wQ2i4Dt7cAMNf9A", "produtos" : [ { "nome" : "coca cola",...
asked by 25.08.2016 / 05:17
3
answers

Grep with multiple parameters

I need to select the rows of a file that contains the characters | or \ diff -y ontem.csv hoje.csv | grep -e "|" -e "\" How to tell pro grep to return the rows it contains either a | or a \ ?     
asked by 05.07.2018 / 19:49
2
answers

swap shell commands

The command python foo.py When called on the terminal, it runs the sent python file. Imagine that I have a python file that always needs to be called as follows: xvfb-run python foo.py to work. Is there any way I can write something...
asked by 27.05.2015 / 14:40
3
answers

How to create a folder with the current date name in Windows cmd.exe

What I already have: %date% is the windows variable that stores the current date. When I use echo %date% the value Tue 07/25/2017 is correctly printed. But when I try to do mkdir %date% the created folder is Tue...
asked by 25.07.2017 / 22:18
1
answer

How to sort a column of a file without sorting the rows?

I have a file that has three columns, and several rows. The second column is made up of numeric values, and I want to rearrange it, in ascending order, but without affecting the previous and subsequent column. exemplo do arquivo: 7.31937 736...
asked by 11.10.2016 / 15:29
2
answers

Function in Shell script with no return

I have the following function: function ping { nome=$(dialog --title "inform o endereço que deseja PINGAR" --inputbox "IP ou URL - \ Lembrando que será disparado 10 pings para o endereço informado." 10 45 --stdout) status=$? if [[ $status -eq...
asked by 13.08.2015 / 05:37
4
answers

Make one copy at a time from the source file, to the destination files

A new need arose accompanied by a good new question that until then I did not find anything similar on the internet - Copy a single line at a time, for a single different file . Example for each new line to be copied: total=10 linha='ca...
asked by 02.02.2018 / 13:36
1
answer

Compiling zookeeper client on a solaris machine, libtool error

I'm trying to compile the client zookeeper 3.4.12c on a machine solaris , below are the steps I followed. unzip the source code, enter the folder zookeeper-x.x.x / src / c. make a "./configure [OPTIONS]" to generate the makes...
asked by 28.06.2018 / 13:16