Skip to content

Commit

Permalink
3 maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina Rudometova committed Sep 30, 2024
1 parent b21d215 commit 1aa7b06
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions solution/addsuffix
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/bin/bash

suffix=$1
extention=$2
suffix=''

#for filename in *.*; do
if [ ${filename##*/} -eq $extention ] then
mv -v "$filename" "$filename$suffix"
fi
#done
for opt in $@
do
echo "suffix is $suffix"
if [[ ! -n "$suffix" ]]; then
suffix="$opt"
echo "suffix assigned to be $suffix"
else
echo "will move $opt to $opt$suffix"
mv "$opt" "$opt$suffix"
echo "move done"
fi
done

0 comments on commit 1aa7b06

Please sign in to comment.