File tree Expand file tree Collapse file tree 14 files changed +15
-40
lines changed Expand file tree Collapse file tree 14 files changed +15
-40
lines changed Original file line number Diff line number Diff line change 10
10
# @author Jerry Lee (oldratlee at gmail dot com)
11
11
set -eEuo pipefail
12
12
13
- # NOTE: DO NOT declare var PROG as readonly in ONE line!
14
- PROG=$( basename -- " $0 " )
15
- readonly PROG
13
+ readonly PROG=${0##*/ }
16
14
readonly PROG_VERSION=' 2.x-dev'
17
15
18
16
# ###############################################################################
Original file line number Diff line number Diff line change 12
12
# @author Jerry Lee (oldratlee at gmail dot com)
13
13
set -eEuo pipefail
14
14
15
- # NOTE: DO NOT declare var PROG as readonly in ONE line!
16
- PROG=$( basename -- " $0 " )
17
- readonly PROG
15
+ readonly PROG=${0##*/ }
18
16
readonly PROG_VERSION=' 2.x-dev'
19
17
20
18
# ###############################################################################
Original file line number Diff line number Diff line change 26
26
# var2=$(echo value1)
27
27
set -eEuo pipefail
28
28
29
- # NOTE: DO NOT declare var PROG as readonly in ONE line!
30
- PROG=$( basename -- " $0 " )
31
- readonly PROG
29
+ readonly PROG=${0##*/ }
32
30
readonly PROG_VERSION=' 2.x-dev'
33
31
34
32
# ###############################################################################
Original file line number Diff line number Diff line change 11
11
# @author Jerry Lee (oldratlee at gmail dot com)
12
12
set -eEuo pipefail
13
13
14
- # NOTE: DO NOT declare var PROG as readonly in ONE line!
15
- PROG=$( basename -- " $0 " )
16
- readonly PROG
14
+ readonly PROG=${0##*/ }
17
15
readonly PROG_VERSION=' 2.x-dev'
18
16
19
17
# ###############################################################################
Original file line number Diff line number Diff line change 9
9
# @author Jerry Lee (oldratlee at gmail dot com)
10
10
set -eEuo pipefail
11
11
12
- PROG=$( basename -- " $0 " )
13
- readonly PROG
12
+ readonly PROG=${0##*/ }
14
13
readonly PROG_VERSION=' 2.x-dev'
15
14
16
15
# ###############################################################################
@@ -207,8 +206,7 @@ if [ ! -f "$specified_run_command" ]; then
207
206
run_command=$( which " $specified_run_command " )
208
207
fi
209
208
run_command=$( portableReadLink " $run_command " )
210
- run_command_base_name=$( basename -- " $run_command " )
211
- readonly run_command run_command_base_name
209
+ readonly run_command run_command_base_name=${run_command##*/ }
212
210
213
211
run_timestamp=$( date " +%Y%m%d_%H%M%S" )
214
212
readonly run_timestamp
Original file line number Diff line number Diff line change 31
31
# var2=$(echo value1)
32
32
set -eEuo pipefail
33
33
34
- # NOTE: DO NOT declare var PROG as readonly in ONE line!
35
- PROG=$( basename -- " $0 " )
36
- readonly PROG
34
+ readonly PROG=${0##*/ }
37
35
readonly PROG_VERSION=' 2.x-dev'
38
36
39
37
# ###############################################################################
Original file line number Diff line number Diff line change 12
12
# @author Jerry Lee (oldratlee at gmail dot com)
13
13
set -eEuo pipefail
14
14
15
- # NOTE: DO NOT declare var PROG as readonly in ONE line!
16
- PROG=$( basename -- " $0 " )
17
- readonly PROG
15
+ readonly PROG=${0##*/ }
18
16
readonly PROG_VERSION=' 2.x-dev'
19
17
20
18
# ###############################################################################
Original file line number Diff line number Diff line change 25
25
# local var2
26
26
# var2=$(echo value1)
27
27
28
- # NOTE: DO NOT declare var PROG as readonly in ONE line!
29
- PROG=$( basename -- " $0 " )
30
- readonly PROG
28
+ readonly PROG=${0##*/ }
31
29
readonly PROG_VERSION=' 2.x-dev'
32
30
# choosing between $0 and BASH_SOURCE
33
31
# https://stackoverflow.com/a/35006505/922688
Original file line number Diff line number Diff line change 11
11
# @author Jerry Lee (oldratlee at gmail dot com)
12
12
set -eEuo pipefail
13
13
14
- # NOTE: DO NOT declare var PROG as readonly in ONE line!
15
- PROG=$( basename -- " $0 " )
16
- readonly PROG
14
+ readonly PROG=${0##*/ }
17
15
readonly PROG_VERSION=' 2.x-dev'
18
16
19
17
# ###############################################################################
Original file line number Diff line number Diff line change 10
10
# @author @sunuslee (sunuslee at gmail dot com)
11
11
set -eEuo pipefail
12
12
13
- # NOTE: DO NOT declare var PROG as readonly in ONE line!
14
- PROG=$( basename -- " $0 " )
15
- readonly PROG
13
+ readonly PROG=${0##*/ }
16
14
readonly PROG_VERSION=' 2.x-dev'
17
15
18
16
# ###############################################################################
You can’t perform that action at this time.
0 commit comments