All Questions

Filter by
Sorted by
Tagged with
1
vote
3answers
131 views

how to filter inner quotes? [closed]

is it possible to filter, i.e to put ESC in front of the inner quotes with sed, awk or other *NIX tool (no perl/python)? Example (revised): $ echo label=\"123 \"456\" 789\" \"AB C\" e f gh | magic-...
1
vote
2answers
1k views

Define a variable to awk pattern matching from bash

I am trying to grab 100 lines after the text "time: X" with X in {0,40,80,...,200}. Here is what I have so far: #!/bin/bash start=1 end=5 for i in $(seq $start $end);do j=$(($i*40)) awk '/time: ...
3
votes
3answers
468 views

Why awk understand FS=“*” but not for FS=“-*-”?

I got a test file, its content is: a -*- b I used awk 'BEGIN {FS="*"} {print $2}' test, it prints out - b Correct! But when I use awk 'BEGIN {FS="-*-"} {print $2}' test, I got: * I know that FS ...