-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfds_unlim
More file actions
executable file
·47 lines (41 loc) · 849 Bytes
/
fds_unlim
File metadata and controls
executable file
·47 lines (41 loc) · 849 Bytes
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
#!/usr/bin/bash
ULIMIT_VALUE=""
function help() {
echo "Usage: $0 [--ulimit value] [--help] FDS_INPUT_FILE"
echo "Options:"
echo " --ulimit value Set ulimit value"
echo " --help Display this message"
}
args=$(getopt -o '' --long ulimit:,help -n "$0" -- "$@")
eval set -- "$args"
while true; do
case "$1" in
--ulimit)
ULIMIT_VALUE=$2
shift 2
;;
--help)
help
exit 0
;;
--)
shift
break
;;
*)
echo "Unrecognised option '$1'"
help
exit 1
;;
esac
done
if [ $# -eq 0 ]; then
echo "No input file provided."
help
exit 1
fi
if [ -z "$ULIMIT_VALUE" ]; then
fds $1
else
ulimit -s $ULIMIT_VALUE && fds $1
fi