diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2024-11-21 10:04:34 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2024-11-21 10:05:04 +0100 |
| commit | 59297cbd2a6a5c78f131e3b1a8c60710198f5213 (patch) | |
| tree | 55af1f12903d58bb11556a9f18f46428b5d055d8 /local/bin/junk | |
| parent | 01f55c6e0a6005bbb051246cd08af49e09fd137c (diff) | |
| download | dotfiles-59297cbd2a6a5c78f131e3b1a8c60710198f5213.tar.gz dotfiles-59297cbd2a6a5c78f131e3b1a8c60710198f5213.tar.bz2 dotfiles-59297cbd2a6a5c78f131e3b1a8c60710198f5213.zip | |
Fixing shellcheck errors
Diffstat (limited to 'local/bin/junk')
| -rwxr-xr-x | local/bin/junk | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/local/bin/junk b/local/bin/junk index faf9b32..9758f68 100755 --- a/local/bin/junk +++ b/local/bin/junk @@ -11,9 +11,11 @@ do if [ -e "$dest" ] then echo "$dest already exists, generating a prefix" - identifier="$(seq 100 | xargs -I N sh -c "echo N; test -e '$dest__N' || exit 255" 2> /dev/null | tail -n1)" + identifier="$(seq 100 | xargs -I N sh -c "echo N; test -e '""$dest""__N' || exit 255" 2> /dev/null | tail -n1)" dest="$dest"__"$identifier" fi - mv "$arg" "$dest" && - echo "$arg moved to $dest" || true + if mv "$arg" "$dest" + then + echo "$arg moved to $dest" + fi done |
