-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile.sh
More file actions
28 lines (18 loc) · 816 Bytes
/
Copy pathfile.sh
File metadata and controls
28 lines (18 loc) · 816 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
#!/usr/bin/bash
if [ -n "$file_isSourced" ]; then return; fi
. "validate.sh" && validate_shellVersion
declare -gri file_isSourced=1
################################################################################
# Size #########################################################################
file_getSize() {
. "log.sh"
local shellOptions_old_varName="${FUNCNAME[0]}_shellOptions_old"
sh_saveOptions "$shellOptions_old_varName"
sh_restoreOptions sh_initialOptions
set -eu -o pipefail
[[ ! -f "$1" ]] && log_fatal -f "File not found: ${1}"
wc -c "$1" | awk '{print $1}'
sh_restoreOptions "$shellOptions_old_varName"
return 0
} ##############################################################################
################################################################################