Results 1 to 3 of 3

Thread: xclip paste without ending return statement

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Location
    Galway, Ireland
    Beans
    30
    Distro
    Ubuntu Development Release

    xclip paste without ending return statement

    I have a small script which extracts some text and pipes it to xclip ready for pasting somewhere else by using

    Code:
    $ some command | xclip -selection c
    The problem I'm having is that the return string giving back from xclip always has a return statement added at the end of it. This is very well for pasting on a text editor but if I want to paste it on the terminal as one of the parameters everytime I paste it it ends the command not allowing me to enter the full command.

    Code:
    $ comand (xclip paste) some more command
    So, is there a way to paste from xclip without the ending return statement?
    Let the source be with you...

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    7,051

    Re: xclip paste without ending return statement

    The output from the command, that you pipe into xclip contains a newline, that you need to remove. Try to remove it with tr like this

    Code:
    echo '# hello world' |tr -d '\n'| xclip -selection c

  3. #3
    Join Date
    Aug 2007
    Location
    Galway, Ireland
    Beans
    30
    Distro
    Ubuntu Development Release

    Re: xclip paste without ending return statement

    That work!!!

    Thank you so much
    Let the source be with you...

Tags for this Thread

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
  •