Skip to content

Commit

Permalink
Remove eval usage
Browse files Browse the repository at this point in the history
* We can execute directly a variable content
* input/output in this case must be explicit and can't be set in variable
  • Loading branch information
camlafit committed Aug 27, 2024
1 parent 6d642e9 commit 57aa1df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions screen-save-all-sessions
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ do
savedir="~${screen_user}/.screen-save/$(date +%Y-%m-%d)/"
command="mkdir -p ${savedir}"
if [ "$EUID" -ne 0 ]; then
eval "${command}"
${command}
else
su - "${screen_user}" -c "${command}"
fi
fi
command="${SCRIPTDIR}/screen-save ${screen_pid} ${savedir} </dev/null"
command="${SCRIPTDIR}/screen-save ${screen_pid} ${savedir}"
if [ "$EUID" -ne 0 ]; then
eval "${command}"
${command} </dev/null
else
su - "${screen_user}" -c "${command}"
su - "${screen_user}" -c "${command} </dev/null"
fi
done

0 comments on commit 57aa1df

Please sign in to comment.