Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Double Space File output AWK
01-11-2010, 09:06 AM (This post was last modified: 01-11-2010 08:25 PM by drdebcol.)
Post: #1
Double Space File output AWK
Notice have no begin end in here. You don't need to add begin and end if your not going to use it. If you don't put anything in the begin opening it would just be a error. The printf statement is just like in c. the \n\n is for 2 newlines and the $0 is a argument that returns a entire line. You can run this program as the name you save it is and execute it like this ./myscript filenamehere
To save the output to the file you can do. ./myscript filenamehere > doublespace.txt

Code:
#!/bin/bash
awk '

{
    printf("%s\n\n",$0);          
}

' "$1"
Visit this user's website Find all posts by this user
Quote this message in a reply
01-11-2010, 08:26 PM
Post: #2
RE: Double Space File output AWK
Very good i must say.

BTW I edited your post to make code brackets okay, end of the code didn't contain slash "/", so i decided put it there.

"I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: