Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
csh script: listing files & dir
Name: matt_sti (by lil_sti) Date: November 21, 2006 at 21:17:51 Pacific OS: UNIX CPU/Ram: 256MB Product: SUN
Comment:
I am trying to create a script in UNIX that will list the files in the current directory. Also, if there is a another directory within the current directory it will list its contents. I am fairly new to csh. I was able to get the first part where the contents of the current directory is printed. I am having trouble with how to go to the next directory and print its contents.
Here is a sample of what I have so far:
foreach file (*) if (-d $file) then echo $file "(directory)" else if (-e $file) then echo $file "(file)" end
Name: wizard-fred Date: November 22, 2006 at 01:38:34 Pacific
Reply:
Have you tried 'ls' list directory? I don't have my Linux/UNIX computer up, but I seem to rememember that there is an equivalent to the DOS command 'dir /s'. I use to pipe it to a file for further examination.
Summary: Ok, how do I have a script that lists all the folders within its directory? Then have a question asking with directory the user wants to open.. when they open the folder, have the batch script CALL an...
Summary: I want to list files and directories in a given directory with gcc (linux). SO I need a variable DIR my_dir; an further with diropen, dirclose, rewdir an so on. But while compiling it sais something l...
Summary: hey guys, after you had such a great solution for the first problem, i have now another ;-) i want the batch to check a specific directory, let's say "c:\files", list all files, that end with *.ppt, a...