37af2a Update cli_getTemporalFile:

Authored and Committed by areguera 13 years ago
    Update cli_getTemporalFile:
    
        - Stop using '/proc/sys/kernel/random/uuid' and start using RANDOM
          variable instead.
    
    
        
Scripts/Functions/cli_getTemporalFile.sh CHANGED
@@ -35,18 +35,15 @@ function cli_getTemporalFile {
35
35
# Check default base name for temporal file, it can't be an empty
36
36
# value.
37
37
if [[ "$NAME" == '' ]];then
38
- cli_printMessage "`gettext "First argument cannot be empty."`" --as-error-line
38
+ cli_printMessage "`gettext "The first argument cannot be empty."`" --as-error-line
39
39
fi
40
40
41
41
# Define source location where temporal files will be stored.
42
42
local TMPDIR='/tmp'
43
43
44
- # Define unique identifier for temporal file.
45
- local UUID=$(cat /proc/sys/kernel/random/uuid)
46
-
47
44
# Define absolute path for temporal file using the program name,
48
45
# the current locale, the unique identifier and the file name.
49
- local TMPFILE="${TMPDIR}/${CLI_PROGRAM}-$(cli_getCurrentLocale)-${UUID}-${NAME}"
46
+ local TMPFILE="${TMPDIR}/${CLI_PROGRAM}-${RANDOM}-${NAME}"
50
47
51
48
# Output absolute path to final temporal file.
52
49
echo $TMPFILE