Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Shell script

Shell script
Thread Tools
Mac Enthusiast
Join Date: Oct 2000
Location: Toronto
Status: Offline
Reply With Quote
Nov 11, 2000, 02:46 PM
 
Hello, I hope somebody can help me. I'm looking for a script or program, which will read a directory (which I specify), and export a ascii text file with the full path to the documents in that folder. Is there any such thing? How could I do this?

Thanks in advance.
anothermacguy
     
Mac Enthusiast
Join Date: Oct 2000
Location: Toronto
Status: Offline
Reply With Quote
Nov 11, 2000, 04:35 PM
 
Please disregard the above question...but I do have another

This (I think) is a quick one...

How do I write a script so that I can input a variable?

For example: lets say I wanted to change directories to something within /Library/WebServer/

and my script was called "webserver" and had this inside it:

------

#!/bin/sh
cd /Library/WebServer/XXXXXXX

------

I want to change directories to something within /Library/WebServer (in this example "Logs") by typing:

./webserver -Logs

What do I need to replace the XXXXX with so that this works?

In this example, I want the result to change directories to /Library/WebServer/Logs.

I hope this is understandable. Thanks in advance...


[This message has been edited by anothermacguy (edited 11-11-2000).]
     
Mac Enthusiast
Join Date: Oct 2000
Location: Toronto
Status: Offline
Reply With Quote
Nov 12, 2000, 01:46 AM
 
It's ok, I fooled around, and got the answer. For other interested newbies, the answer was:

$1 (replaces the XXXXXX's)
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:42 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2