#!/bin/bash # a script to change the extension of a file from a given value to .txt param="java" # the default is to work on .java file if [ "$1" != "" ]; then param=$1 #if a command line parameter is given, use it. fi for f in *.$param; do #first way to get rid of all dots in the file name. Uses tr #aa=`echo $f | tr -d .` #echo $aa #ln -s $f $aa.txt # More efficient way to get rid of dots ... # THis uses built into shell string manipulation echo ${f/.} ln -s $f ${f/.}.txt done