-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnome.sh
executable file
·41 lines (36 loc) · 851 Bytes
/
nome.sh
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
#!/bin/zsh -
#===============================================================================
#
# FILE: nome.sh
#
# USAGE: ./nome.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Cláudio "Patola" Sampaio (Patola), [email protected]
# ORGANIZATION: MakerLinux
# CREATED: 22/07/2018 22:53:52 -03
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
typef=()
[[ $# < 1 ]] && {
echo "Needs at least one argument (filename)"
exit 1
}
[[ "$1" == "-f" ]] && {
typef=(-type f)
shift
}
if [[ "$1" == "-d" && "$2" != "" ]]
then
dir="$2"
shift 2
else
dir="."
fi
/usr/bin/find "$dir" $typef -iname "*${1}*"