From 218d7a652371a87a2e649c1fa280f148046ed944 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Sat, 26 Oct 2019 18:16:12 +0200 Subject: [PATCH] Determine type: Redirect stderr for ls --- games/save.game.home | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/games/save.game.home b/games/save.game.home index 986ecf9..9024949 100755 --- a/games/save.game.home +++ b/games/save.game.home @@ -99,7 +99,7 @@ fi IFS="%" for game_path in ${games_list}; do local_game_path="${HOME}/${game_path}" - local_game_path_type="$(ls -ld "${local_game_path}" | sed 's/\(^.\).*/\1/')" + local_game_path_type="$(ls -ld -- "${local_game_path}" 2> /dev/null | sed 's/\(^.\).*/\1/')" game_name="$(basename "${game_path}")" game_dir="$(dirname "${game_path}")" @@ -125,7 +125,6 @@ for game_path in ${games_list}; do symlink_game_dir "${game_name}" "${game_dir}" ### If the symlink failed if [ "${?}" != 0 ]; then - echo $? printf '\e[1;35m%-6s\e[m\n' "Data of ${game_path} (Homedir) − ${local_game_path} are not managed. Type: ${local_game_path_type}. Abort" exit 3 fi