From a2f210820562cf4302b1d627d026f879418a4201 Mon Sep 17 00:00:00 2001 From: Kotov_Alexei Date: Wed, 2 Nov 2022 17:49:31 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw3_ex1.sh | 3 +++ hw3_ex2.sh | 3 +++ hw3_ex3.sh | 2 ++ hw3_ex4.sh | 4 ++++ hw3_ex5.sh | 9 +++++++++ 5 files changed, 21 insertions(+) create mode 100644 hw3_ex1.sh create mode 100644 hw3_ex2.sh create mode 100644 hw3_ex3.sh create mode 100644 hw3_ex4.sh create mode 100644 hw3_ex5.sh 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