dcb59c bash scripts: replace '[ ]' with '[[ ]]' for bash scripts

Authored and Committed by liutgnu 2 years ago
    bash scripts: replace '[ ]' with '[[ ]]' for bash scripts
    
    upstream: fedora
    resolves: bz2003832
    conflict:
        function load_kdump_kernel_key() not presented in rhel9,
        so related patch hunk are removed.
    
    commit 70978c00e5a573f0901ac404067eaea2c6536370
    Author: Kairui Song <kasong@redhat.com>
    Date:   Wed Sep 8 17:20:51 2021 +0800
    
        bash scripts: replace '[ ]' with '[[ ]]' for bash scripts
    
        kdumpctl, mkdumprd, *-module-setup.sh only target bash, since they
        only run in first kernel and depend on dracut, and dracut depends
        on bash. So use '[[ ]]' to replace '[ ]'.
    
        This is a batch update done with following command:
        `sed -i -e 's/\(\s\)\[\s\([^]]*\)\s\]/\1\[\[\ \2 \]\]/g' kdumpctl, mkdumprd, *-module-setup.sh`
        and replaced [ ... -a ... ] with [[ ... ]] && [[ ... ]] manually.
    
        See https://tldp.org/LDP/abs/html/testconstructs.html for more details
        on '[[ ]]', it's more versatile, safer, and slightly faster than '[ ]'.
    
        This will also help shfmt to clean up the code in later commits.
    
        Signed-off-by: Kairui Song <kasong@redhat.com>
        Acked-by: Philipp Rudo <prudo@redhat.com>
    
    Signed-off-by: Tao Liu <ltao@redhat.com>
    
        
file modified
+54 -54
file modified
+107 -107
file modified
+25 -25
file modified
+1 -1