Find the answer to your Linux question:
Results 1 to 2 of 2
Hey all As stated, I am worthless at scripting, for I have no real knowledge of any common scripting langauge used in the linux world (be it bash, python, etc) ...
  1. #1
    Just Joined! robz0rz's Avatar
    Join Date
    Apr 2007
    Location
    Germany
    Posts
    19

    Worthless at scripting, need help archieving simple goal

    Hey all

    As stated, I am worthless at scripting, for I have no real knowledge of any common scripting langauge used in the linux world (be it bash, python, etc)

    Imagine I have a directory structure full of subdirectories filled with SVG files and soft links to SVG files in this directory structure. I will be voncerting all the SVG files to PNG files, but that will obviously break the soft links to them. So what I want to do is have a script that tracks down all symlinks in the directory structure for me and changes the linked file from "link-target.svg" to "link-target.png".

    How would I do this?

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    find -type l will find the symbolic links for you. If you directed this into a file, you could then do a construction like:
    Code:
    for link in `cat linkfile` do
    rm -f $link
    ln -s $link.png $link
    done
    "I'm just a little old lady; don't try to dazzle me with jargon!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...