Skip to content

Commit

Permalink
Upd
Browse files Browse the repository at this point in the history
  • Loading branch information
EvelinaVinnikova committed Oct 4, 2024
1 parent 26a9383 commit 1b4194d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions solution/addsuffix
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/bin/bash

if [ "$#" -lt 2 ]; then
exit 1
fi
[ "$#" -lt 2 ] && exit 1

suffix="$1"
shift

for file in "$@"; do
[ -e "$file" ] && mv "$file" "${file}${suffix}" || exit 1
[ -e "$file" ] && mv -- "$file" "${file}${suffix}" || exit 1
done

0 comments on commit 1b4194d

Please sign in to comment.