Skip to content

Commit

Permalink
replace command cp with cp for POSIX-guaranteed utility
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasLarson committed Dec 12, 2021
1 parent 6ea9d3b commit ee3c5bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setup/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ command find -- . -type d -empty \
# if sed installation was successful, and
# if zsh is available, replace bash, ash, and sh with zsh in `/etc/passwd`
command -v zsh >/dev/null 2>&1 && command grep -E '/bin/b?a?sh' /etc/passwd 2>&1 &&
command cp -- /etc/passwd /etc/passwd-"$(command date '+%Y%m%d')" &&
cp -- /etc/passwd /etc/passwd-"$(command date '+%Y%m%d')" &&
# `-i` for in-place editing
# `-E` for regex searching for `/bin/ash` and `/bin/sh`
command sed -i -E "s|/bin/b?a?sh$|$(command -v zsh)|g" /etc/passwd
Expand Down

0 comments on commit ee3c5bf

Please sign in to comment.