0

By using some shell command i filter some output Please can some one suggest how i can print this output in some file

For example I filtered some line and save it to some file but problem is it is starting with 2 nd line in first line it is showing blank line in second line it is showing my output can any one suggest how i can print my data in first line of file means how we can delet that space

cat file1 | awk '{if ($2==$3) { print }}' | awk '{print $5, $6, $7, $8}' > file
  • Can you post an example input, an example actual output and an example expected output? – garethTheRed Sep 10 '14 at 5:27
0
$ awk '{if ($2==$3) { print }}' file1 | \
    awk '{print $5, $6, $7, $8}' | tail -n +2 > file
  • 1
    Welcome to U&L. Could you please take a few moments to explain your answer a bit? We generally like our A's to be more than just a line of code. Thanks! – slm Sep 11 '14 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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