l1
This commit is contained in:
commit
c054752be7
6 changed files with 29 additions and 0 deletions
3
lab1/1.bash
Executable file
3
lab1/1.bash
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
find "$1" -type f
|
3
lab1/2.bash
Executable file
3
lab1/2.bash
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
grep -Roh '\w*' "$1" | sort | uniq -c | sort -nr
|
6
lab1/3.bash
Executable file
6
lab1/3.bash
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
for word in $(grep -Roh '\w*' "$1" | sort | uniq)
|
||||||
|
do
|
||||||
|
echo "$(grep -lRw "$word" "$1" | wc -l) $word"
|
||||||
|
done | sort -r
|
7
lab1/4.bash
Executable file
7
lab1/4.bash
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
for word in $(grep -Roh '\w*' "$1" | sort | uniq)
|
||||||
|
do
|
||||||
|
echo "current word: $word"
|
||||||
|
grep -Rw "$word" "$1"
|
||||||
|
done
|
3
lab1/5.bash
Executable file
3
lab1/5.bash
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
find "$1" -type f -print0 | xargs -0 sed -i "s/a/A/g"
|
7
lab1/6.bash
Executable file
7
lab1/6.bash
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
for word in $(grep -Roh '\w*' "$1" | sort | uniq)
|
||||||
|
do
|
||||||
|
echo "current word: $word"
|
||||||
|
grep -RE "($word.*){2}" "$1"
|
||||||
|
done
|
Loading…
Reference in a new issue