bash

How do I remove the error output when running a command?

For example, the command: $ grep -lr "sample" . In addition to printing files that contain the string "sample", it outputs errors that clutter the output. grep:: No such file or directorygrep: : No such file or directory

Bash: How do I call a function on Bash inside a command argument?

How do I call a function on Bash inside a command argument ? There is such a system of directories Aircrack-NG_scripts | +--+ ... m directory and to perform this function in the sudo airmon-ng stop get_mon_interface command. How to fix it, please tell me.

Converting strings to numbers in bash-e

countlines=0 cat file.txt | while read line do countlines=$countlines+1 echo $line done count=0 number1=0 number2= ... used in the for loop (the value of the number of iterations), how do I make number2 in the for loop be perceived as a number?

How to copy the contents of a folder with a given extension to another folder while maintaining the original directory structure in linux

How do I copy files of only a certain extension to another folder in Ubuntu, while maintaining the structure of the original ... ents of the subfolders were also copied, only what has the extension .h This is analogous to the command mac: gcp --parents

How do I make a loop for sed on bash?

Who can tell you how to properly make a loop for sed on bash? Or how to read a file in multiple lines? A file can consist of ... while read line; do echo TEST1 + $line; done cat test1.txt | sed -n 22,32p | while read line; do echo TEST2 + $line; done

bash script over ssh

I'm trying to write a script that would use ssh to execute certain commands to choose from, i.e. enter the name of the comput ... kill -9 $(ps aux | grep 1cv8 |grep "Отчеты" | awk '{print $2}') else echo "Ввели не правильное значение" fi !

Bash script execution time in milliseconds

There is a regular test script that copies the contents of the folder and shows the time of the operation at the end. But thi ... wnloads /home/it/Downloads/bash-time # конец скрипта END=$(date +%s) DIFF=$(( $END - $START )) echo "It took $DIFF seconds"

Delete lines in files of a certain folder recursively before a certain date SED, AWK

Tell me how to use sed, awk to delete everything that is older than 7 days recursively in all files, in all folders /home/*/ ... 8-12-23 23:34:43.358 7 INFO 2019-06-12 12:33:43.358 7 INFO 2020-05-12 11:23:43.358 7 INFO 2020-09-23 10:34:43.358 7 INFO

Remove all asterisks from a variable

How to remove all asterisks from a variable. The variable is a text and there are characters "*". You need to delete them all. Preferably using only bash

Installing GDevelop on ubuntu 18.04

I wanted to see what GDevelop 5 is - I downloaded a file from the official website. the site. I executed the command chmod a+ ... n error is returned bash: ./GDevelop-5-5.0.0-beta97.AppImage: cannot execute binary file: Exec format error What should I do?

How to pass the result of the Expect operation to a bash script

There is a bash script that executes Expect internally. The short meaning is that a bash script hangs on the crown, which co ... ы надо вернуть в bash #Завершение выполнения expect: expect eof " The call to expect is done like this: expect -c "$COMM"

Connect to remote mysql in Ubuntu terminal

Error when connecting to a remote mysql database. I am trying to connect to Ubuntu via the console utility "mysql". In the fu ... meta_desc','meta_keys','0','0','0','0','1','6','1','','0','pagetitle','','com_content_read.tpl'); EOF The answer is the same

BASH script + passed parameter + asterisk-rx

Hello everyone. I'm trying to create a small script for Asterisk for Zabbix monitoring. The script will specify ' sip show ', ... on is, what am I doing wrong? And how do I get the script to receive the passed argument and pass it to the asterisk command?

How do I do this on PowerShell?

Hello everyone Need help rewriting a single-line script. :) #!/bin/bash grep -vwE "ДнейОтсрочки" "Doc_2020-01.xml" > 01_ ... currence). The result is written (output) to a file 01_new.xml Feature: the search string and the xml file in UTF-8 encoding

How can I convert milliseconds to seconds in bash, rounded to the second digit?

There is a number in milliseconds. For example, 564. You need to get the number of seconds rounded to the second digit, that ... is not good. Arithmetic operations will not be performed later with the number, so it is enough to get a string in the output

Can there be a TTY without Bash. How does the interaction with the kernel work?

I decided to figure out how Linux interacts with the OS itself, not counting syscalls. In my view, we have ttys, to which pse ... s of syscalls. Or I don't understand something, but I can't run another tty without a command interpreter (bash or not bash)

Create a directory with the current date name

You need to create a directory as the current date. I wrote such a function cddate () { local newdir newdir=$(date +%Y.%m.%d) mkdir $newdir cd $newdir } Is it possible to do the same without using a variable?

How to run sh scripts correctly?

When running hadoop sh scripts, I am constantly asked for the root password (I did not perform any manipulations with the r ... t turns out that I can run the sh script as sh <scriptName>, or I can just <scriptName>. What's the difference?

Checking the existence of a file

Need a bash script that takes 1 parameter, i.e. I call it ./script filename And it checks if the file exists and outputs a message that the file either exists or not, you can name it exists.sh.