aboutsummaryrefslogtreecommitdiff
path: root/functions/chext.fish
blob: 5f8132f03d0e69d318755689d725bb69ac41d4a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function chext --description 'Change extension of files with an extension' -a sourceext -a targetext

if test (count $argv) -lt 2
  echo 'Missing argument.'
  return 1
end

for file in *.$sourceext
  echo mv $file (path change-extension $targetext $file)
end

end