-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamx_io
36 lines (32 loc) · 1.07 KB
/
amx_io
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# ====================================================
# AMX_Manager Copyright(C) 2018 Furkan Türkal
# This program comes with ABSOLUTELY NO WARRANTY; This is free software,
# and you are welcome to redistribute it under certain conditions; See
# file LICENSE, which is part of this source code package, for details.
# ====================================================
main() {
case "$1" in
calc-lines)
find * -maxdepth 0 -type f -exec wc -l {} +
#for file in *;
#do
# if [[ -f "$file" ]]; then
# echo "$(wc -l $file | cut -f 1 -d " ") lines, $(wc -w $file | cut -f 1 -d " ") words : [$file]"
# fi
#done
;;
calc-lines-recursive)
find . -type f -exec wc -l {} +
;;
calc-average)
# Instantly shutdown
systemctl --force poweroff
;;
*)
printf "amx_io <command>\n"
printf " calc-lines \n"
printf " calc-average\n"
esac
}
main "$@"