script Beispiele ergänzt
This commit is contained in:
9
beispiele/archive-dir.sh
Normal file
9
beispiele/archive-dir.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
if [ -z "$1" ]; then
|
||||
echo usage: $0 directory
|
||||
exit
|
||||
fi
|
||||
SRCD=$1
|
||||
TGTD="/home/$USER/backups/"
|
||||
OF=home-$(date +%Y%m%d).tgz
|
||||
tar -czf $TGTD$OF $SRCD
|
7
beispiele/recursive-grep-in-file.sh
Normal file
7
beispiele/recursive-grep-in-file.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n $2 ]
|
||||
grep -r --include="*.$2" "$1" .
|
||||
else
|
||||
grep -r "$1" .
|
||||
fi
|
Reference in New Issue
Block a user