Questions tagged as 'unix'

1
answer

SED replace the same case for something

I'm trying to replace occurrences of "strings that appear in the document" by another value in the case '' nothing; I have the following code snippet in shell script mkdir NOVO for script in *.sql do sed '/from/ s/fev_\|jan_//g' $script...
asked by 27.06.2018 / 04:01
1
answer

Group SQL results by date

So, I have a table that registers the login of the players, all the values in unix timestamp, and I wanted to know how I can know the day when there were more records, and adding the total, the day that there were more SEG_Online , AJ_Envadas an...
asked by 07.10.2018 / 20:47
1
answer

while read does not work in Unix shell script

I am programming a script and using while read twice it does 1 only once: un=$(echo $LOGNAME | tr '[A-Z]' '[a-z]') grep -v '^#' nodeteste.txt > auxiliar.txt while read line do ssh "$un@$line" "cat arquivo" > arquivo.externo cu...
asked by 13.02.2018 / 18:59
0
answers

Code with Sockets locking in the middle

Because of college networking stuff, lately I have had experiences to learn how to deal with sockets in C. But today, trying to develop a candle game to practice, I had a rather peculiar problem. Apparently, the code I wrote does not have any syn...
asked by 07.10.2017 / 03:10
0
answers

Shel Script [tail] return line at the end of each concatenated file

Live, I have several files with the same headers. what I wanted to do is copy the contents of all the files to within 1 so but only with 1 header. I already managed to do this part with the code below head -3 $FILE1 > all.csv tail -n...
asked by 08.06.2017 / 17:49
1
answer

Save txt file with windows encoding

My application runs on a Unix OS, so my .TXT files are created in UNIX format, I need these files to be created in WINDOWS format. I need line breaks to be in WINDOWS format \ r \ n. I'm having trouble with UNIX format because it only...
asked by 30.08.2016 / 22:17
1
answer

Doubt with use of 'pthread' in posix

I am using the following routine with command pthread.h library: // // Declaração // pthread_t threads[NUM_THREADS]; // // Criacao // for(...) { pthread_create(&threads[i], NULL, MainTH, (void *) &thread_ar...
asked by 02.08.2016 / 14:44
1
answer

application for optimization support, shell command correction for mac

I'm wondering how to optimize the following shell command in Mac OSX in order to fulfill the function you want to basically copy all files xx folder to the xx2 folder: ditto $(mdfind xx1) ~/Desktop/xx2 or ditto $(mdfind -onlyin ~/...
asked by 04.07.2016 / 15:57