Results 1 to 5 of 5

Thread: I need help with sed in bash

  1. #1
    Join Date
    May 2005
    Location
    Indiana
    Beans
    1,933
    Distro
    Hardy Heron (Ubuntu Development)

    I need help with sed in bash

    I've worked for hours to try to get my .docx & .xlsx files to be associated with my MS Office that was installed with PlayOnLinux. I'm finding out that PlayOnLinux is great for installing things, but not so great for actually using them.

    Anyway, I finally figured out how to use mimeopen -d to create a custom command for playonlinux to associate files in Nautilus. The only problem was that it didn't work if the filename or folder name had spaces. So I found where someone put the following code in the PlayOnLinux shortcut scripts for Word and Excel. That code makes it work with spaces, but a side effect of this code is that it replaces all 'C's with 'Z's in the file and folder names. Can anyone tell me exactly what this is doing, and maybe how to get it to work with spaces, but not replace the 'C's? Here's the code:
    Code:
    "$(echo "$@" | sed -e 's:C:Z:' -e 's:/*/:\\:g')"
    Today you are You, that is truer than true. There is no one alive who is Youer than You. - Dr. Seuss

  2. #2
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: I need help with sed in bash

    Code:
    's:C:Z:'
    What if you remove this chunk. It's what substitutes C for Z

  3. #3
    Join Date
    May 2005
    Location
    Indiana
    Beans
    1,933
    Distro
    Hardy Heron (Ubuntu Development)

    Re: I need help with sed in bash

    It worked perfectly without that. Thank you very much. I don't know why the guy had that in there.

    Thanks again.
    Today you are You, that is truer than true. There is no one alive who is Youer than You. - Dr. Seuss

  4. #4
    Join Date
    May 2005
    Location
    Indiana
    Beans
    1,933
    Distro
    Hardy Heron (Ubuntu Development)

    Re: I need help with sed in bash

    Quote Originally Posted by wojox View Post
    Code:
    's:C:Z:'
    What if you remove this chunk. It's what substitutes C for Z
    I just wanted to let you know that in the Wine subforums, I wrote a HowTo about how to do all of the things I was trying to get done, and I credited you for helping me with that code.

    Thanks again.
    Today you are You, that is truer than true. There is no one alive who is Youer than You. - Dr. Seuss

  5. #5
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: I need help with sed in bash

    You are welcome and thank you.

Bookmarks

Posting Permissions

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