diff --git a/.shell.d/funs_rc b/.shell.d/funs_rc index 6a2dcc9b..13b13a2a 100644 --- a/.shell.d/funs_rc +++ b/.shell.d/funs_rc @@ -191,7 +191,7 @@ bindatasearch() return fi - if [ $(du -b Cover.jpg | awk '{print $1}') -gt 1048576 ]; then + if [ $(wc -c Cover.jpg | cut -f1 -d' ') -gt 1048576 ]; then echo "[$1] file size must not exceed 1MB." return fi diff --git a/.zshrc b/.zshrc index 808db76f..43282d4d 100644 --- a/.zshrc +++ b/.zshrc @@ -2,7 +2,8 @@ ## Shell Config -- Master File ################################################################################ -readonly SHELL_CURRENT="$(ps -o command="" $$)" +## Note that 'ps -o command= $$' gives the same result with parameters. +readonly SHELL_CURRENT="$(ps -o comm= $$)" readonly SHELL_DIR="$HOME/.shell.d" ## .profile is sourced automatically by most login managers, but we need to