Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Transform input text with sed command

  1. #11
    Join Date
    Jan 2013
    Beans
    88
    Distro
    Edubuntu

    Re: Transform input text with sed command

    Quote Originally Posted by vasa1 View Post
    I found this:
    Code:
    echo "08002738cb55" | fold -w2 | paste -sd':' -
    08:00:27:38:cb:55
    BTW, can someone tells me what does last "-" in this command?

  2. #12
    Join Date
    Dec 2007
    Beans
    12,533

    Re: Transform input text with sed command

    Quote Originally Posted by CrewDK View Post
    BTW, can someone tells me what does last "-" in this command?
    man fold has this:
    Code:
          With no FILE, or when FILE is -, read standard input.
    Edit: I forgot all about the pipe! But, as matt symes points out, man paste makes the same use of "-".
    Last edited by vasa1; May 6th, 2016 at 02:43 PM.

  3. #13
    Join Date
    May 2010
    Location
    uk
    Beans
    9,299
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Transform input text with sed command

    Hi

    Quote Originally Posted by vasa1 View Post
    man fold has this:
    Code:
          With no FILE, or when FILE is -, read standard input.
    I think it's the paste command that's reading from standard input, vasa, as it also has that option.

    Kind regards
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  4. #14
    Join Date
    Dec 2007
    Beans
    12,533

    Re: Transform input text with sed command

    Quote Originally Posted by matt_symes View Post
    ...
    I think it's the paste command that's reading from standard input, vasa, as it also has that option.
    ...
    Oops! You're right as usual

    I'll try and salvage my post.

Page 2 of 2 FirstFirst 12

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
  •