I'm just learning shell scripting specifically in bash, I want to be able to use gzip to take files from a target directory and send them to a different directory. I enter directories in the command line. ext is for the extensions I want to zip and file will be the new zipped file. **My script zips the files correctly**, to and from the desired directories, **but I get a no such file or directory error**. How do I avoid this?

Current code

```
cd $1

for ext in $*; do
    for file in `ls *.$ext`; do
        gzip -c $file > $2/$file.gz
    done 
done

```

and my I/O

```
blackton@ltsp-amd64-charlie:~/Desktop/60256$ bash myCompress /home/blackton/Desktop/ /home/blackton/ txt
ls: cannot access *./home/blackton/Desktop/: No such file or directory
ls: cannot access *./home/blackton/: No such file or directory
gzip: alg: No such file or directory
gzip: proj.txt: No such file or directory

```