TimtheEagle <[EMAIL PROTECTED]> writes: This is actually all unrelated to bash.
> + awk -v 'var1=Framed-IP-Address = 10\.6\.6\.' '/*** Received from > 10.242.252.20 port 1645 ..../{ last_acct_status = NR; as = $0 }/Code: `*' and `.' are special in regexps, you need to quote them to match them as literals. > Access-Accept/ && last_acct_status + 1 == NR {last_user_name = NR; print > NR-1 as; print NR $0 }/$var1/ && last_acct_status + 10 == NR { print NR $0 /.../ is the syntax for a literal regexp. To match against a variable use `$0 ~ var1' (awk does not use $ to refer to variables). > }' /tmp/theout > awk: warning: escape sequence `\.' treated as plain `.' The value is parsed as a string. To include a backslash in a string write it as \\. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."