Посоветуйте способ ввода данных по аналогии с 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
dos2unix СКРИПТ
echo "Write your domain without http and www:"
read sitedomain
DIR="/var/www/$sitedomain"
sudo mkdir -p "$DIR/public_html"
echo "Hello world" > "$DIR/public_html/index.html"