Anyone have a little script/prog to make linking easier?

Discussion in 'OT Technology' started by DJ-phYre, Dec 2, 2004.

  1. DJ-phYre

    DJ-phYre Active Member

    Joined:
    Jun 5, 2003
    Messages:
    6,359
    Likes Received:
    0
    Location:
    Louisiana
    Say I wanted to link 100 pics... all different filenames and no common scheme... it is a bitch to link them
     
  2. HWYKING

    HWYKING OT Supporter

    Joined:
    May 12, 2004
    Messages:
    4,424
    Likes Received:
    0
    Location:
    Seattle area
    can you telnet/ssh into the server?
     
  3. rengo

    rengo Are you ready to rock, BK broiler!?

    Joined:
    Mar 11, 2004
    Messages:
    5,889
    Likes Received:
    0
    Location:
    Oakdale, MN
    i use excel to make my links a lot of the time..some good formulas you can use to create them.
     
  4. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    :werd: If you can then it's easy to write a little script to do it in TCL or Perl or whatever. If you don't then with a little more trouble you can get a PHP script to do it.
     
  5. HWYKING

    HWYKING OT Supporter

    Joined:
    May 12, 2004
    Messages:
    4,424
    Likes Received:
    0
    Location:
    Seattle area
    $ ls -l
    total 140
    -rw-r--r-- 1 myPics pg144559 61969 Nov 17 21:58 DSC01111-Medium.JPG
    -rw-r--r-- 1 myPics pg144559 26535 Oct 15 18:18 mike2b.jpg
    -rw-r--r-- 1 myPics pg144559 46237 Nov 29 15:40 verticle.JPG
    $
    $
    $
    $ ls -l | awk '{print "<img src=\"http://www.mypics.com/"$9"\">"'}

    <img src="http://www.mypics.com/DSC01111-Medium.JPG">
    <img src="http://www.mypics.com/mike2b.jpg">
    <img src="http://www.mypics.com/verticle.JPG">
    $

    ****************************************************

    so pretty much just modify the line in bold above so the base URL is where your pics are at and the $9 might need to be changed depending on what column the file name is in when you do an ls -l on your machine. So if it is in the 8th column you would change it to $8.

    Then you can copy and paste into a file and add your <html> and <body> tags.
     
    Last edited: Dec 3, 2004
  6. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    It's even easier if you use ls -1 since it will give you just the file names, one on each line.
     
  7. HWYKING

    HWYKING OT Supporter

    Joined:
    May 12, 2004
    Messages:
    4,424
    Likes Received:
    0
    Location:
    Seattle area
    ah damn that's the command I was looking for. I remember using that before but I couldn't remember it. thanks! :x:
     
  8. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    I remembered using it, but couldn't remember the exact command. Had to look in the man page :embd:
     

Share This Page