Need help with sed to fix migrated web site links (part II)

I thought I had this fixed, but I didn't, so starting over:
I'm moving my web files from one host to another, and have backed up my directory called WEB into my user downloads folder.  The site is dead simple, mostly links within the site, pages primarily text with some links to my photos posted on flickr, and a few outside links.  I want to avoid opening/replacing/saving a hundred or more files to fix the links from "http://www.old_domain_name/user/my_username" to "http://my_new_domain_name"
A friend suggested the following scripts to do this
  mkdir fix_urls
  cd fix_urls
  cp -r <wherever>/WEB .
  cd WEB
  xargs -0 egrep -i  old_domain_name $(find * -name "*.html" -print0) > ../to_fix
  cd ..
  less to_fix
to see what needs changing, but after I've created and moved to WEB, the xargs command results in a zero kb file called to_fix appearing in WEB, and nothing else happens....and the prompt in terminal (myusername$) doesn't reappear.
I tried his part II anyway:
  mkdir new_web
  while read filename; do
      sed 's/\/www.old_domain_name/user/my_username/\/my_new_domain_name/' < WEB/$filename > new_web/$filename
  done
  diff -r WEB new_web > what_i_did
  less what_i_did
and after the 'done', I get again....nothing.  No new cursor gray rectangle, no new prompt, haven't even gotten to the last bit of diff to review the changes.
Any tips on what fundamental bone-headed thing I'm doing wrong?
and I got this helpful answer which seemed to have solved it, but didn't entirely:
This solved my question by X423424X  on Jul 1, 2012 1:23 AM
I want to avoid opening/replacing/saving a hundred or more files to fix the links from "http://www.old_domain_name/user/my_username" to "http://my_new_domain_name"
If that's all you want to do then here's the pertinent sed command to do it:
sed -e 's,www.old_domain_name/user/my_username,my_new_domain_name,'
Syntax is a bit simpler when you don't use slashes as the sed substitute delimiters.  You can use anything.  Here I used commas.
I got excited too quickly after the first file I clicked looked correct--the first file in the subdirectory.
I see no indication in terminal that the process is going or ending--no sense of when I can close terminal and move on.
Checking the directory in finder shows no updates to 'date modified' for any of the files.
So how do I know if it is in progress, or done working, aside from opening random files to see if they're 'done'?
I've got three subfolders inside one folder (my WEB folder), and it looks like only the first file of the first subdirectory got repaired.

Here is a bash script to interate through all files in a folder of a given extension.
#!/bin/bash
# be sure to use Unix lineends -- linefeed \n
# Use TextWrangle for editing.  It's free.
# http://www.barebones.com/products/TextWrangler/
# or nano in the terminal
# to make this file -- listFile.bash runable do:
# chmod u+x listFile.bash
# debug info
export PS4='+(${BASH_SOURCE}:${LINENO}):'
# remove the leading # in the line below to show debug info
# set -o xtrace
# first comes the directory/folder you want to search
# -name do a case independent search for all file ending
#       with the extension .txt
find /Users/mac/Desktop/iMac -iname "*.txt" | while read file
do
    echo
    echo "file to process is = " $file
    # replace the list command with your command.
    # You will need to place a $ in front of file
    # To avoid problems with blanks & other characters,
    # put " around $file, your variable.
    ls -l "$file"
done
mac $ chmod u+x /Users/mac/Desktop/listFiles.bash
mac $ /Users/mac/Desktop/listFiles.bash
file to process is =  /Users/mac/Desktop/iMac/bash/pdisk-l.txt
-rw-r--r--   1 mac  staff  20915 Feb  4  2009 /Users/mac/Desktop/iMac/bash/pdisk-l.txt
file to process is =  /Users/mac/Desktop/iMac/comments on new forum software.txt
-rw-r--r--   1 mac  staff  1966 May 26  2011 /Users/mac/Desktop/iMac/comments on new forum software.txt
file to process is =  /Users/mac/Desktop/iMac/hidden mac os files.txt
-rw-r--r--   1 mac  staff  1499 Jul  1 17:01 /Users/mac/Desktop/iMac/hidden mac os files.txt
file to process is =  /Users/mac/Desktop/iMac/key combinations.txt
-rw-r--r--   1 mac  staff  2547 Aug 24  2011 /Users/mac/Desktop/iMac/key combinations.txt
file to process is =  /Users/mac/Desktop/iMac/nvram -p.txt
-rw-r--r--   1 mac  staff  1248 Feb  1  2011 /Users/mac/Desktop/iMac/nvram -p.txt
file to process is =  /Users/mac/Desktop/iMac/reset mac Open Firmware.txt
-rw-r--r--   1 mac  staff  7876 Jun 25 21:56 /Users/mac/Desktop/iMac/reset mac Open Firmware.txt
mac $

Similar Messages

  • Need help with URL Redirect in Sun Web Server 7 u5

    All I am trying to do is redirect to a static URL and for the life of me I can not get it to behave the way I would expect. I am new to Sun Web Server so I am just trying to use the Admin Console to set this up.
    Here is what I'm trying to do:
    Redirect from - http://www.oldsite.com/store/store.html?store_id=2154
    To - http://www.newsite.com/Stores/StoreFront.aspx?StoreId=2154
    Here's what I tried in the console.
    Added a new URL Redirect
    Set the Source to be Condition and set it to: '^/store_id=2154$' (quotes included)
    Then set the Target to: http://www.newsite.com/Stores/StoreFront.aspx?StoreId=2154
    Then for the URL Type I checked Fixed URL
    When I tested with: http://www.oldsite.com/store/store.html?store_id=2154 it did redirect as desired
    BUT
    When I tested with: "http://www.oldsite.com/store/store.html?store_id=5555" it too got redirected to the Target and I can't figure out how this second URL can satisfy the condition to get redirected.
    Any help is most appreciated.

    thanks for choosing sun web server 7
    it is simpler if you just edit the configuration files manually
    cd <ws7-install-root>/https-<hostname>/config/
    edit obj.conf or <hostname>-obj.conf (if there is one for you depending on your configuration so that it look something like)
    <Object name="default">
    AuthTrans..
    #add the folllowing line here
    <If defined $query>
    <If $urlhost =~ "/oldsite.com" and
    $uri =~ "/store/store.html" and
    $query =~ "store_id=2154" >
    NameTrans fn="redirect" from="/" http://www.newsite.com/Stores/StoreFront.aspx?StoreId=2154
    </If>
    </If>
    ..rest of the existing obj.conf. continues
    NameTrans...
    now, you can either do <ws7-install-root>/https-<hostname>/bin/reconfig -> to reload your configuration without any server downtime or <ws7-install-root>/https-<hostname>/bin/restart -> to restart the server
    if it did work out for your, you will need to run the following so that admin server is aware of what you just did
    <ws7-install-root>/bin/wadm pull-config user=admin config=<hostname> <hostname.domainname>
    hope this helps

  • [SOLVED] Need Help with Sed

    Since I'm a dirty TF2 idler and I use Source Tools to idle, it uses a list of servers from a servers.txt file.
    A list of idling servers is here: http://tf2stats.net/blacklist_generate/ … ourcetools
    The list is in this format:
    {IP ADDRESS}:{PORT};{SERVER NAME}
    Unfortunately, I can't just save that as the list, because it thinks you're trying to send {SERVER NAME} as a command or something.
    There's ~920 lines that are just that and so I need to remove everything AFTER the port number (so it would be the colon and the server name).
    The tricky part is that not all ports are the same. 27015 is the standard, some use 27016, and some use other ones. So I need to have a sed command to remove everything past a colon on all lines, then remove the colon on all lines.
    And since I suck at sed, I've come crawling to the forums for help. So please, help.
    Last edited by Arm-the-Homeless (2010-04-05 23:47:19)

    Procyon wrote:@brisbin33: if you're going to redefine IFS, why not to :; with while read ip port name
    true story.  IFS=$'\n'; while read -r is just a habit i fall back on when i want to read [possibly inconsistent] lines out of a file.

  • I need help with exporting project for the web

    Probably something i am doing wron g but here are the problems. When I use Quicktime Converter, if I try to convert to a Quicktime movie or an MPEG-4 nothing happens and i get a 'File error;File Unknown message' when i try to convert to an AVI File, it works, but even though I have already rendered the project, it shows up with little flashes of blue that say 'unrendered'. and finally, when I try to make it a w
    Windows Media File, it stops after 29 seconds. Any ideas?
    I have an iMac with dual core processor, and FCE HD 3.5.1. I have my video files on an external drive.
    iMac   Mac OS X (10.4.10)  

    perform a search using the term export for web and it should throw up some ideas.
    here's one for starters:
    http://discussions.apple.com/thread.jspa?messageID=2309121&#2309121
    If you're using flip4mac to convert to wmv, the trial stops at 30 seconds - you need at least wmvstudio to export to wmv:
    http://www.flip4mac.com/wmv.htm

  • Need help with iPhoto Aperture Lightroom migration

    Would really appreciate some advice on this last stage of the move from iPhoto to Lightroom, as Im sure getting my files into the right place is crucial.
    Here is where I'm at right now: 
    I had an old iphoto (v8.3 or something) library with about 30,000 images on a macbook pro (late 2008) which I moved over to my newer iMac, to merge with an existing library of about 8,000 photos which I was managing with Aperture.
    Per some advice I got on how to consolidate iPhoto libraries, I opened the old iPhoto library on my newer iMac running the latest iPhoto version, and then I honestly can't remember exactly what I did after that... but I got both libraries into one, and now I have all my photos merged and sorted into folders and projects, and all looks great. Except for one thing: its still showing up as an iphoto library in finder. There is no Aperture library file or folder anywhere. I guess I needed to "import" at some point, rather than simply opening the library? 
    My original plan was to get everything into an Aperture library before moving to Lightroom. Maybe it doesn't matter. My main concern before I make the move to Lightroom is keeping my newly organized folder hierarchy (with all projects and albums in tact). And I understand I need to change from managed to referenced library for this. So is it just as simple as "relocating the originals"?     

    Sorry, maybe I can rephrase my question:
    My photos are already sorted into this structure, in Aperture, as a managed library:
    PHOTOGRAPHY (main folder)
    - PROCESSED
            GROUP A
            GROUP B
            GROUP C
            PROJECTS
                 PROJECT 1
                 PROJECT 2
                 PROJECT 3
    - WORK IN PROGRESS
            GROUP D
            GROUP E
            GROUP F
    How can I make this into a referenced library?
    I understand I need to select all my photos and then choose the "relocate originals" option.
    What comes next?  

  • Need help with 3 column fixed in internet explorer

    Hi, I'm having a major problem that won't go away. I'm using
    an 3 column fixed style sheet, which renders fine in Safari and
    Firefox, but won't in Internet explorerer. I always get about a
    10px space between the left column and the content area that is
    transparent. ( you can see the background.) Also the spry menu bar
    is off to the right on i.e. ( don't know if that info. matters or
    not) ANY suggestions would be appreciated! Tim from this forum has
    been more than kind and re-wrote the whole code for the page. The
    copy he sent me rendered fine, but when I deleted my files and
    added his still had the problem. ( only this time the space is on
    the left, last time on the right.) He did get the spry tabs to work
    for me! I'm sure it's something stupid I'm missing on my end. Tim
    is unbelieveably talented and way too nice to help me like this.
    Anyone have any suggestions so I can leave poor Tim alone for a
    little while!!! Thanks much

    Hello,
    Somehow a LOT of whitespace got added into a number of tags
    in the code in
    your copy vs the one I sent.
    I removed it all and it works fine.
    I sent you the page again.
    Take care,
    Tim
    "kidcoconut" <[email protected]> wrote in
    message
    news:fpjs9q$8ns$[email protected]..
    > Hi, I'm having a major problem that won't go away. I'm
    using an 3 column
    > fixed
    > style sheet, which renders fine in Safari and Firefox,
    but won't in
    > Internet
    > explorerer. I always get about a 10px space between the
    left column and
    > the
    > content area that is transparent. ( you can see the
    background.) Also the
    > spry
    > menu bar is off to the right on i.e. ( don't know if
    that info. matters or
    > not)
    > ANY suggestions would be appreciated! Tim from this
    forum has been more
    > than
    > kind and re-wrote the whole code for the page. The copy
    he sent me
    > rendered
    > fine, but when I deleted my files and added his still
    had the problem. (
    > only
    > this time the space is on the left, last time on the
    right.) He did get
    > the
    > spry tabs to work for me! I'm sure it's something stupid
    I'm missing on my
    > end.
    > Tim is unbelieveably talented and way too nice to help
    me like this.
    > Anyone
    > have any suggestions so I can leave poor Tim alone for a
    little while!!!
    > Thanks much
    >

  • I need help with FileZilla launching of a Muse site, please!

    I have built a site with Muse for a local non-profit child care center. They already have a webhost and hosting plan, so I do not need (cannot afford) the business catalyst version. The site looks great on business catalyst, as well as in all the previews. When I upload via FileZilla, all looks good, but I cannot get the site to go "live"... Please help! What do I need to do?

    You said they already have a webhost and hosting plan (but not a domain name). Are you replacing existing files on the server with a domain name? If so I would suggest backing up the site and then you'll probably want to remove all the old files and replace them with the new files.
    If you are not replacing existing files: Have you actually purchased a domain name yet for the site? Having a webhost and plan doesn't necessarly mean you have your domain name ie" "Adobe.com". If you don't have a domain name, there is no place to point your browser for it to be "live".
    What is the domain name you are using for the site? Maybe we can check out what happens when we call it up.

  • I can't find my serial number and once I do I would like to move my Pro to another computer. Need help with both.

    I can't find my serial number and once I do I would like to move my Pro to another computer. Need help with both.

    Hi Rick ,
    Here is the link that will help you find the serial number for your product quickly .
    https://helpx.adobe.com/x-productkb/global/find-serial-number.html
    You would have to deactivate that software from your older machine first.
    Refer to the following link to deactivate your product .
    https://helpx.adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html
    After it is deactivated from the older machine you can use it on your new machine just by entering the serial number of the product .
    Let us know if you need further assistance.
    Regards
    Sukrit Dhingra

  • Hello, I need help with my macbook pro. It looks like I cannot install anything anymore. Everytime I try to install a new software, use the migration assistant or click the lock to make changes, it simply does not react.

    Hello, I need help with my macbook pro.
    It looks like I cannot install anything anymore. Everytime I try to install a new software, I simply get stuck during the installation type process. I put in my password, it does accept it, but it does not go any further.
    I tried to reset the password, put no password, repair the permissions, the disk but nothing will do. I nearly got stuck with the log in screen but finally succeeded in disabling it.
    So I thought I might try to create a new account but I cannot click the lock to make changes. It simply refuses to react.
    I am now thinking about using the migration assistant to save all my settings, data and so fourth, but again I get stuck when I have to type in my password. It accepts it but nothing happens...
    I guess it has something to do with the authorization process, but can't find anything on the internet about it... Can you help me out?
    I am running Lion 10.7.3.
    Regards,
    Nicolas.
    (I apologize if any grammatical/structural mistakes were to be found, english is not my mother-tongue. )

    You probably won't like this suggestion, but I suggest you reinstall Lion.
    First, backup your system. Next, reboot your system, press/hold the COMMAND-R keys to boot into the Recovery HD. Select 'Reinstall Mac OS X'. If you purchased Lion as an upgrade to Snow Leopard, the reinstall process will install Lion 10.7.3. If your system came preinstalled with Lion, you might still get Lion 10.7.2. Both installs are a total install of the OS. None of your apps or data will be impacted. Just the OS.

  • I need help with my shockwave flash it is crashed i need help fixing

    I need help with shockwave flash it is crash i need help fixing it

    http://forums.adobe.com/thread/1195540

  • I had to put my computer by together without migration or time machine I NEED help with order of the files?

    I had to put my computer by together without migration or time machine I NEED help with order of the files?

    Hi, where are these other files exactly?

  • I need help with the Web Application Certificate

    Greets,
    The title says it all really. I need help with the Web Application Certificate.
    I've followed the instructions from here:
    https://www.novell.com/documentation....html#b13qz9rn
    I can get as far as item 3.c
    3. Getting Your Certificate Officially Signed
    C. Select the self-signed certificate, then click File > Certification Request > Import CA Reply.
    I can get the certificate in to the Filr appliance but from there I'm stuck.
    Any help much appreciated.

    Originally Posted by bentinker
    Greets,
    The title says it all really. I need help with the Web Application Certificate.
    I've followed the instructions from here:
    https://www.novell.com/documentation....html#b13qz9rn
    I can get as far as item 3.c
    ok when you have you self signed certificate and you requested an official certificate with the corresponding CSR then you just need to go back to the digital certificates console. To import the official certificate, select the self signed certificate, then click File > Certification Request > Import CA Reply. Then a new windows pops out to select the certificate from your trusted authority from your local hard disk. Find the file (.cer worked for me) and click ok. As soon as you do this in the digital certificates console the self signed certificate will change the information that now it is officially signed. Look at the second column and you should see the name of your trusted authority under "issue from"
    I personally had a lot of issues across all platforms. Especially Firefox and Chrome for android. Needed to pack all the root cert, intermediate cert and signed cert into one file and import as CA reply. Not even sure if this is correct now. But at least it works.

  • Need Help with a Flash Web Project

    Hello, everyone. I am trying to use Flash to make a two-step
    system. I want the flash document to, first, allow a person to
    upload multiple image files and then, second, for the flash
    document be able to create a slideshow with the uploaded images and
    fade in and out from each image until the slideshow is over. I want
    it to be where the flash document creates its own slideshow with
    the images that are uploaded in the first step that I mentioned. I
    want it to do it completely on its own so I need to know how to
    give it the proper AI so that it can do this task.
    So, are there any tips that anyone has on how to do this? Can
    anyone tell me exactly how to do this? I really need help with this
    for my new website project. Thanks in advance, everyone!

    The problem with the text not appearing at all has to do with you setting the alpha of the movieclip to 0%.  Not within the movieclip, but the movieclip itself.  The same for the xray graphic, except you have that as a graphic symbol rather than a movieclip.  To have that play while inhabiting one frame you'll need to change it to a movieclip symbol.
    To get the text to play after the blinds (just a minor critique, I'd speed up the blinds), you will want to add some code in the frame where you added the stop in the blinds animation.  You will also need to assign instance names for the text movieclips in the properties panel, as well as place a stop(); in their first frames (inside).
    Let's say you name them upperText and lowerText.  Then the code you'd add at the end of the blinds animation (in the stop frame) would be...
    _parent.upperText.play();
    _parent.lowerText.play();
    The "_parent" portion of that is used to target the timeline that is containing the item making the command, basically meaning it's the guy inside the blinds telling the guy outside the blinds to do something.
    You'll probably want to add stops to the ends of the text animations as well.
    If you want to have the first text trigger the second text, then you'd take that second line above and place it in the last frame of the first text animation instead of the blinds animation.
    Note, on occasion, undeterminably, that code above doesn't work for some odd reason... the animation plays to the next frame and stops... so if you run into that, just put a play(); in the second frame to help push it along.
    PS GotoandPlay would actually be gotoAndPlay, and for the code above you could substitute play(); with gotoAndPlay(2);

  • I need help with IOS 7, there is a major bug that needs to be fixed in an upcoming Update

    There is a big that needs to be FIXED an in upcoming update.
    Ok, on my ipad, the notifacation center says the weather is going to be 13 degrees celceuis, I am wanting to use the American metric units, which is Fahrenheit, how do I fix it, it says yahoo provides weather info! I taped on it, it led me to the internet, it said on yahoos website that it is 88 degrees Fahrenheit, but it won't show up on my ipad notifaction center,  how do I fix it?? Need help
    I have already done a hard reset, I also did location service off and then back on, the problems persist, some one told me that a third party weather app was changing the weather to celceuis, this is NOT true, need help how do I fix this?
    I have IPAD 3 gen, IOS 7

    Apple will never see your post here
    They do not monitor these posts for problems
    You really should post at
    http://www.apple.com/feedback/iphone.html
    http://www.apple.com/feedback/ipod.html
    http://www.apple.com/feedback/ipodtouch.html
    http://www.apple.com/feedback/ipad.html
    Allan

  • Need help with cannon RAW photos

    Please help- let my employee go and nearly 100 photos of my products were left on my hard drive, but I can not get them to open.  They are somehow jacked up (show a different icon than they did).  They have no previous version, and absolutely NOTHING I have tried to open them will work.  Would someone be willing to test one to see if they can figgure it out?  Or, has anyone fixed this problem before?

    You are a genius! Now that I understand that those are support
    files, and know what I am looking (at) and for- I found all the photos.
    She left us in quite a mess- both with the photos and our web page so
    thank you again for helping. Feel free to let me know if you need
    anything in the future. I won't forget your help!
    Cristi
    910 10th Street, Greeley, CO 80631
    P: 970-351-6398
    F:
    1-970-352-1085
    [email protected]
    facebook.com/AwardAlliance
    www.awardalliance.com
    Award Alliance is always doing cool
    things on our facebook! Come like us, and maybe see your awards featured
    there! (facebook.com/AwardAlliance)
    On 2013-09-26 19:35, ssprengel
    wrote:
    RE: NEED HELP WITH CANNON RAW PHOTOS
    created by
    ssprengel in Photoshop Lightroom - View the full discussion

Maybe you are looking for

  • Connection between SDM client and server is broken

    Dear All, First of all this is what I have -NW04 SPS 17 -NWDS Version: 7.0.09 Build id: 200608262203 -using VPN connection -telnet on port 57018 is succesfull I can login to SDM server (from NWDS and from SDM GUI) I can see the state of SDM(green lig

  • How to get Adobe Camera RAW loaded so I can open RAW files from a Panasonic LX7?

    I opened these images two days ago. Now I get a message that the CS6 Photoshop does not recognize this type of file. I went online and again(3rd time)downloaded Camera RAW 7.3 and tried installing and opening the images. Once again - same thing. Now

  • New iMac won't open iPhoto library

    I copied the iPhoto library from my MacBook Pro to my new iMac. I was running iPhoto 9 on the MBP. When I double-clicked the copied iPhoto library on my iMac, iPhoto opened and said it would have to update the library and I clicked ok. Nothing happen

  • Keynote to PPT?

    I made and saved a Theme in Keynote. Is it possible to use that theme in powerpoint?

  • ENQUEUE_READ in Background

    Hi Experts, I tried ENQUEUE_READ in Background to capture the locks and display the person responsible for the lock and the transaction which is locked. This does not happen has required. In foreground this above FM works fine. Thanks in advance.