consolidation of various example repos/gists

This commit is contained in:
2021-07-15 11:36:18 +02:00
parent 58142d3157
commit 16953bd936
20 changed files with 978 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Allow params a b v
# : is used to disable verbosity
while getopts ":abv" opt; do
# case to handle scenarias
case $opt in
a)
echo "-a passed, Parameter: $OPTARG"
;;
b)
echo "-b passed, Parameter: $OPTARG"
;;
v)
echo "-v passed, Parameter: $OPTARG"
;;
# default case
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done

View File

@@ -0,0 +1,17 @@
#!/bin/bash
# will recursively remove ( and ) from all files
for d in /mnt/series/Smallville/*; do
if [ -d "$d" ]; then
echo ""
echo "=> moving to: $d"
cd "$d"
for f in *.*; do
echo "processing: $f"
des=$(echo "$f" | tr -d '()')
if [ "$f" != "$des" ]; then
mv "$f" "$des"
fi
done
fi
done

9
bash/whiptail.sh Normal file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
Height=$(tput lines)
Width=$(tput cols)
Height=$((Height / 2))
Width=$(((Width * 2) / 3))
whiptail --yesno --title "Hello!" "This is a whiptail window" $Height $Width