-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.functions
50 lines (42 loc) · 954 Bytes
/
.functions
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Recursive replace on macos/BSD sed - use with care, prob super dangerous =)
# Only add if on macos
if [ -d /Users ]; then
recurs-replace() {
grep -e "$1" -rl . | while IFS= read -r file; do
sed -i '' "s/$1/$2/g" "$file"
done
}
fi
# If on macos, set language
if [ -d /Users ]; then
export LANGUAGE=en:en_US:en
else
fi
# Watch pods
wkgpod() {
watch "kubectl get pods -A | grep '$1'"
}
# Watch pv
wkgpv() {
watch "kubectl get pv -A | grep '$1'"
}
# Watch pvc
wkgpvc() {
watch "kubectl get pvc -A | grep '$1'"
}
## Make kubectl returns results by creation time by default
#kubectl() {
# if [[ "$1" == "get" ]]; then
# command kubectl get --sort-by=.metadata.creationTimestamp "${@:2}"
# else
# command kubectl "$@"
# fi
#}
# Function for testing piping
pipetest() {
if [[ $1 ]]; then
echo "This is $1"
else
xargs echo "This is from stdin"
fi
}