Skip to content
Snippets Groups Projects
Commit 63acd569 authored by hdd29's avatar hdd29
Browse files

Q2

parent f576218d
Branches
No related tags found
No related merge requests found
#!/bin/bash
#
#Created by Hanh Do Phung (Teddy)
# 04/17/2019
#
#This is to change extension of files
echo "You passed in $# arguments"
if [ -z $1 ]||[ $# != 2 ]
then
echo -e "Wrong number of arguments, please provide exactly 2 arguments"
exit 2
fi
for file in *.${1}
do
mv "$file" "${file%.${1}}.${2}"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment