[ale] Shell Scripting Question

Pete Hardie pete.hardie at sciatl.com
Wed Dec 10 13:51:06 EST 2003


Nick Travis wrote:
> I'm working on a script that creates a static webpage that lists all of
> the files in a directory, it's working fine except for one thing.  I'm
> getting a blank space when I create the line of html.
> here's the code:
> 
> 
>># create the html to be added to files.html
>>first="<p><a href=\"/music/"
>>middle="\" >"
>>end="</a></p>"
>>                                                                                
>>echo $first $current_file $middle $current_file $end >> /usr/local/apache2/htdocs/music/files.html
> 
> 
> Here's what it gives me:
> /music/ my-file
> 
> I need to get:
> /music/my-file
> 
> any thoughts?  I'm not very experienced in shell scripting, so there's probably a better way to accomplish the same thing.

try taking out the spaces in the echo command.  If that doesn't work, try 
assigning the vairables to another like 'filename=$first$current'



-- 
Pete Hardie                   |   Goalie, DVSG Dart Team
     posting from, but not     |
     speaking for:             |
Scientific Atlanta, Digital Video Services Group



     - - - - - - -  Appended by Scientific-Atlanta, Inc.  - - - - - - -  
This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.



More information about the Ale mailing list