x=($(youtube-dl -g https://www.youtube.com/watch?v=yfHQCNPTios)) && vlc ${x[0]} --input-slave ${x[1]}
Чтобы открыть youtube 1080p в плеере VLC
x=($(youtube-dl -g --format="bestvideo[height<=?1080]+bestaudio" https://www.youtube.com/watch?v=yfHQCNPTios)) && vlc ${x[0]} --input-slave ${x[1]}
mpv --ytdl-format="bestvideo[height<=?1080]+bestaudio" https://www.youtube.com/watch?v=yfHQCNPTios
Как удалить одной командой файл из FTP хранилища с помощью bash? Или предложите свой способ.
HOST="192.168.1.1"
USER="root"
PASS="12345"
DATE=$(date +%y%m%d)
CMD="\
echo 'Начинаю очищать хранилище';\
ls /;\
echo 'Очищаю .. rm -rf lalala';\
echo 'Хранилище очищено '$DATE;\
exit"
lftp -e "$CMD" --user $USER --password $PASS $HOST
lftp -e "ls /;rm -rf file.txt;exit" --user root --password 12345 192.168.1.1
осталась одна ошибка в 7 строке: ./analiz.sh: строка 7: *1: синтаксическая ошибка: ожидается операнд (неверный маркер «*1»)
cpuload=$(($var*1))
cpuload=$[var*1]
cpuload=$[${var:=999}*1]
Посоветуйте способ ввода данных по аналогии с messagebox?
; zenity --entry --text="Введите число:"
; a=$(zenity --entry --text="Введите число:")
DISK=(/dev/nvme0n1 /dev/loop0)
TIME=2
while :; do
i=$(iostat -dsxy $TIME 1 -o JSON ${DISK[*]} | jq -r '.sysstat.hosts[].statistics[].disk[] | "\(.disk_device)\t\(.util) %"')
clear
echo -n -e "$i\n"
done
loop0 0.35 %
nvme0n1 0.42 %
%util
Percentage of elapsed time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100% for devices serving requests serially. But for devices serving requests in parallel, such as RAID arrays and modern SSDs, this number does not reflect their performance limits.
$ LINE="zh_SG GB2312"
$ eval $(echo "$LINE" | awk '{print "var1="$1";var2="$2}')
получим:$ echo "$var1 $var2"
zh_SG GB2312
ru_RU.UTF-8 UTF-8
en_US.UTF-8 UTF-8
zh_SG GB2312
$ lines=(`cat lines.txt`)
$ echo ${lines[0]}
ru_RU.UTF-8
$ echo ${lines[1]}
UTF-8
$ bash --version
GNU bash, версия 5.1.4(1)-release (x86_64-pc-linux-gnu)
...
$ ./untitled.sh 1 1 1 1
script4 - Linux Scripting Book
Parameters: 1 1 1 1
Showing logical AND
Clause 1
Showing logical OR
Clause 1
End of script4
#!/bin/bash
ls -1 |awk '{print $0,$0"_renamed"}' | xargs -n2 mv
ls -1 |awk '{print "\""$0"\" \""$0"_renamed\""}' | xargs -n2 mv
while read str; do
ln "/usr/share/nginx/html/$str" "/usr/share/nginx/html/tst/$str"
done < /home/user/list.txt