From the following link, I tried to use the following solution to compare a group of source files (here fortran90 = *.f90).
To do this and see the source which are different, I have put into my ~/.bashrc :
function diffm { for file in "$1"/"$2"; do diff -qs "$file" "$3"/"${file##*/}"; done ;}
But unfortunately, if I am in the current directory for argument $1
, i.e by execute :
$ diffm . '*.f90' ../../dir2
The result is : impossible to access to './*.f90'
. However, the sources *.f90
exist but wildcards are not taken into account.
Surely a problem with double quotes on arguments of my function ($1
, $2
, $3
)?
More generally, this function doesn't work well.
How can I modify this function in order to make it work in all cases, even being in the current directory ".
" for the first argument $1
or the third $3
?