Questions tagged [bash] (1109)

3
answers

In bash'e remove space option?

People don't know where the errorfirst=$(echo $1 | xargs) alias trunc_spv='echo /var/log/supervisor/$first' This code does not cut the gaps, but if instead offirst=$(echo $1 | xargs) writefirst=$(echo ' p ' | xargs) the gaps will cut yourself.Specifically the problem is We need to make an alias that will execute the wipe co...
kayli_Ortiz asked April 4th 20 at 13:19
1
answer

Bash, wget, post, and brackets. How to make friends?

Good night! Using wget I send the following post request: --post-data="name=$name&direction[]=1,3,5" The second part of the server processes with error .. How to overcome the problem )) ? Thanks in advance ))
hugh asked April 4th 20 at 13:15
0
answer

Is there a possibility to *nix at the command prompt to pull the File Version and Product Version of the exe?

Hi all. The question in the title. There is a server on Ubuntu, it periodically fly (or whatever) of Windows executable files. There is a need to pull the File and Product version. Is this possible in UNIX? Thank you.
Wyatt asked April 4th 20 at 13:07
4
answers

How to write the error output of the ssh command into a variable and execute it at the same time?

cmd="ssh -f-N -M-S $sock_file -p $remote_port -D $local_port -i $key_file $user@$host" cmd_out=$($cmd 2>&1) This scheme works when there are errors, but hangs if there are no errors on the following:debug3: receive packet: type 4 debug1: Remote: /home/user/.ssh/authorized_keys:1: key options: agent-forwarding port-fo...
Ashly_Hagenes74 asked April 4th 20 at 13:06
2
answers

How to parse logs using bash?

Good afternoon. There is a need in the log view:RESULT=xxxxx, TIME=2020-01-20 18:43:12, HOST=xxxxxxxxxxx, NAME=xxxxxxxx what would the value of TIME time is recorded in a completely moronic view - TIME=18:43:12.000 +0700 Mon Jan 20 2020. No other billing is not accepted. Fast and straight in the forehead nakodil this monst...
nels_Olson asked April 4th 20 at 13:03
2
answers

How to make a subquery to a database using SED?

The task is simple you need to bring in a new line the name of the domain from the subquery to the database via the ID in the mail Watching the mail queue mailq|grep ^[A-F0-9] |cut-c 42-80| sort | uniq -c| sort-n2 web175@ks02.ru 5 web174@ks02.ru 6 web137@ks02.ru 8 web221@ks02.ru 10 web217@ks02.ru 27 web178@ks02.ru Let us le...
Natalia_Shields asked April 4th 20 at 13:03
2
answers

In bash wget to save the file with the name of the part of the link?

Good time of day. There is a file with 10,000+ links that need to download with wget. In the file links in the form: google.com/page?=abcde Will be stored as html pages. Accordingly, if register wget -i links.txt the files will be in the form ofindex.htmlindex.html.1index.html.2 Is there a possibility of using wget to save ...
eden_Halvorson88 asked April 4th 20 at 12:42
2
answers

What makes this script?

To work the old admin, loved to write the scripts without comments. I Linux zero, the power can supply,install programs and everything. I would like to know of course its better, tell me and if possible explain what does this script? Thanks in advance.spoiler#!/bin/bash /bin/mount-a; echo > /var/log/backup_rsync_all DATE...
araceli_Trembl asked April 4th 20 at 12:42
4
answers

How to pass a cron from a script?

Hello! The problem is this. There is a certain script. One of its tasks is to add a cron job Before writing this line, decided to test and found the following. If a cron to add so, you overwrite the previous one, which in principle is logical, but the task runs at the specified interval (every minute):echo "* * * * * rm-rf ...
Buddy.Dickens3 asked April 4th 20 at 12:41
2
answers

How to write a bash script performing the migration from folder 1 to folder 2 all files to the server 1 every 30 min with a description in the log file the results of its work?

Tell me, how to write a bash script that performs the transfer function from folder 1 to folder 2 all files on the server once in 30 minutes with the description in the log file of the result of their work
kennith.Hayes asked April 4th 20 at 12:39