Specifying target directory for command in bash shell script?
so i'm attempting to do some shell scripting using bash, and i'm stuck on one little thing - i've got a certain command i want to run in the script, but i need to specify the directory to run the command on, and i don't know how to do that. now the details:
in the command line, i would just run the command:
ls *jpg *JPG *AVI *avi > list.photos.temp
while in the directory i want to run it on. it looks at the current directory, finds all the files of the specified type, and prints their names to a file. that works.
BUT...i want to put the command into a script, and the script will be running from a different directory. so basically, how do i make this specific line of code run on a directory other than the one the script's in?
thanx in advance.
Last edited by spectrescape; 07-22-2004 at 06:31 PM.