LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 07-22-2004, 06:28 PM   #1
spectrescape
LQ Newbie
 
Registered: Jul 2004
Location: Chicago USA
Distribution: Slackware 10.0
Posts: 6

Rep: Reputation: 0
Specifying target directory for command in bash shell script?


hi guys,
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.
 
Old 07-22-2004, 06:37 PM   #2
spectrescape
LQ Newbie
 
Registered: Jul 2004
Location: Chicago USA
Distribution: Slackware 10.0
Posts: 6

Original Poster
Rep: Reputation: 0
HA - solved it like 5 minutes after that post by (what else) reading the man page!

RTFM strikes again...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with bash shell script !! taiwf Linux - Newbie 5 06-11-2006 07:07 PM
Shell: Tar files: programmatically determining the name of the target directory stefanlasiewski Programming 3 08-17-2005 09:48 PM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-12-2005 12:08 AM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 07:54 PM
how do i chage the color of a file or a directory in a bash shell Paxmaster Linux - Software 3 10-18-2004 12:21 AM


All times are GMT -5. The time now is 12:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration