Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to retrieve the distro name from the lsb_release -i output, but using

lsb_release -i | sed 's/Distributor ID: //g'

won't do the trick.

What am I doing wrong? Or maybe should I change the tool?

share|improve this question
    
I don't know lsb_release and it's not installed on my system. Can you please show us the output of the command before you pipe it into sed? –  rahmu Feb 18 '13 at 9:22
add comment

2 Answers 2

You do not have to manipulate the output if you add the -s or --short option which according to the help "show requested information in short format".

lsb_release -is
share|improve this answer
add comment

The character after the colon is a tab, not a space. Use

s/Distributor ID:\t//

The /g is not needed because the pattern is not repeated on the line.

You can also use much simpler

lsb_release -i | cut -f2-
share|improve this answer
    
Thank You..all options work fine. –  b1tH1de0 Feb 18 '13 at 11:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.