Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd, 2017 please sign up again. Thanks!

[solved] How can i extract Linux command out of e-mail message?

Discussion in 'Command Line' started by postcd, Apr 7, 2017.

  1. postcd

    postcd Guest


    please how can i extract an Linux command out of e-mail message?

    I sent an e-mail with this text:
    and in the received e-mail file is:
    The e-mail encoding is:
    Content-Type: multipart/alternative
    Content-Type: text/html; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Please which example command can i use to extract that Linux command out of the mail file not knowing which command the file will contain, only knowing that the command will be after string "cmd: " ?

    I am able to extract alphanumeric string, but i do not know how to do what i explained.

    (Log in to hide this advertisement)

    Thank You
    #1 postcd, Apr 7, 2017
    Last edited: Apr 7, 2017
  2. postcd

    postcd Guest

    I think this would be quite difficult awk or sed command/s, so i think i will rather make sure e-mail is sent without any special html formating (as a plain text), that way the command seems to remain same as it was typed.
    1 person likes this.
  3. atanere

    atanere Guest

    Exactly. Change your email program to send plain text and it should send it properly.
    1 person likes this.

Share This Page