Timeline for How can I use awk to create a variable that is used in the next line edit
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 2, 2015 at 3:01 | comment | added | jasonwryan | It's the ternary operator. | |
| Sep 2, 2015 at 2:59 | comment | added | Xentrees | I wasn't sure how this worked. what is the ? and the : for? This looks like it could be really useful in other projects I am working on. | |
| Sep 2, 2015 at 2:57 | vote | accept | Xentrees | ||
| Sep 2, 2015 at 2:32 | comment | added | jasonwryan | awk '{if (NF==4) name=$1}; {print (NF==3) ? name $0 : $0 }' file | |
| Sep 2, 2015 at 2:28 | answer | added | user1794469 | timeline score: 1 | |
| Sep 2, 2015 at 1:57 | comment | added | Xentrees | If I try that it will either print the literal $1 or nothing at all | |
| Sep 2, 2015 at 1:52 | comment | added | jasonwryan | Try it with print name, $0... | |
| Sep 2, 2015 at 1:42 | history | asked | Xentrees | CC BY-SA 3.0 |