This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set -e: Fail if some command exits with non-zero status | |
# set -u: Fail on use of uninitialized variable | |
set -eu | |
# Usage | |
if [[ $# -lt 2 ]]; then | |
echo "Usage: $0 -h|--host <host> -u|--user <username> -p|--password <password> [-c|--compression <'gz'|'zip'|'xz'>]" | |
exit 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: ./timediff.sh <starttime in format <hour><minutes>> <endtime> <minutes of pause in between> | |
if [[ $# -lt 2 ]]; then | |
echo 'No time given' | |
fi | |
if [[ $# -lt 3 ]]; then | |
echo 'No pause given' | |
echo "Usage e.g.: $1 0800 1700 60" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# syntax: ./test.sh <file.h> <arguments> | |
createdNewFile=false | |
file=${1##*/} | |
echo $file | |
filename=${file%.h} | |
echo $filename | |
path=${1%$file} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: ./getLineCount.sh *.cs | |
find . -name "$1" -exec wc -l {} \; | mawk '{s+=$1} END {print s}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z $1 ]]; then | |
echo "no search place given!" | |
exit 1 | |
fi | |
if [[ -z $2 ]]; then | |
echo "no file for saving given!" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sync; echo 1 > /proc/sys/vm/drop_caches |