diff --git a/hw3_ex1.sh b/hw3_ex1.sh new file mode 100644 index 0000000..d664d67 --- /dev/null +++ b/hw3_ex1.sh @@ -0,0 +1,3 @@ +#!/bin/bash +SIZE=$RANDOM +dd if=/dev/urandom of=rnd.txt bs=1 count=$SIZE diff --git a/hw3_ex2.sh b/hw3_ex2.sh new file mode 100644 index 0000000..399753a --- /dev/null +++ b/hw3_ex2.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cut -d' ' -f3 digits.txt | paste -sd+ | bc + diff --git a/hw3_ex3.sh b/hw3_ex3.sh new file mode 100644 index 0000000..ddc9c3f --- /dev/null +++ b/hw3_ex3.sh @@ -0,0 +1,2 @@ +#!/bin/bash +find -type f -mtime -1 ! -mmin -30 | wc -l diff --git a/hw3_ex4.sh b/hw3_ex4.sh new file mode 100644 index 0000000..8da88c7 --- /dev/null +++ b/hw3_ex4.sh @@ -0,0 +1,4 @@ +#!/bin/bash +while IFS= read -r line; do + ping -c2 $line>>file1 2>>file2 +done < ips.txt diff --git a/hw3_ex5.sh b/hw3_ex5.sh new file mode 100644 index 0000000..be98806 --- /dev/null +++ b/hw3_ex5.sh @@ -0,0 +1,9 @@ +#!/bin/bash +echo 'Введите число: ' +read NUMBER +if (( $NUMBER % 2 == 0 )) +then + echo '**EVEN**' +else + echo '**ODD**' +fi