Questions tagged [tac]
25 questions
2
votes
2 answers
awk specfic text and print 2 lines above
I have file where I need 2 lines above my match result using awk. I have put together the below and so far so good, however I want to use match case for search:
#cat data.out
{ unload file name = dupli00913.unl number of rows = 251 }
create table…

Christopher Karsten
- 387
- 1
- 2
- 12
2
votes
2 answers
How can i grep the last group of lines using awk?
I have the following contents in my file file.txt
Start
1
2
3
5
end
Start
a
b
c
d
end
How do i use only awk to get the section which is at the end from "start" to "end" as follows?
Start
a
b
c
d
end
Tried efforts:
awk '/Start/ {{ f = 1;n++ }} f &&…

Sandeep
- 23
- 3
2
votes
1 answer
Using tac on most recent log file out of several log files in a directory
I have several log files in a directory that we’ll call path/to/directory that are in the following format after long listing in Red Hat Enterprise 6:
-rw-r——-. 1 root root 17096 Sep 30 11:00 logfile_YYYYDDMM_HHMMSS.log
There are several of these…

Jon
- 21
- 1
1
vote
0 answers
Three Address Code generation using Backpatching in LEX and YACC
Why does this code show segmentation fault?
generator.l
%{
#include "y.tab.h"
%}
%%
[ \t] /* Skip whitespace */
[0-9]+ { yylval.num = atoi(yytext); return NUMBER; }
"if" { return IF;…

Vidhi P Shah
- 11
- 2
1
vote
8 answers
Delete 2 lines of text before the line containing the matching pattern using sed?
I have a file containing the following lines:
aaa
bbb
ccc
pattern
eee
fff
ggg
pattern
hhh
I would like to delete 2 lines before the last matching pattern in the file. The expected output is:
aaa
bbb
ccc
pattern
eee
pattern
hhh
I tried -
sed -i…

Ira
- 547
- 4
- 13
1
vote
5 answers
Merging of two files with substitution
I need to merge two files, adding the contain of the file 2 directly to the end of the file 1. Notable the last line of the first file consist of the phrase "END". I need to remove it and add there the content of the file 2:
file 1:
string 1
string…

Hot JAMS
- 173
- 5
1
vote
2 answers
Search and Print by Two Conditions using AWK
I have this file:
- - - Results from analysis of weight - - -
Akaike Information Criterion 307019.66 (assuming 2 parameters).
Bayesian Information Criterion 307036.93
Approximate stratum variance decomposition
…

Curious G.
- 838
- 8
- 23
1
vote
1 answer
Problem with tac_plus.cfg on Tacacs GUI with error ' /opt/tacacsgui/tac_plus.cfg_test:47: Unrecognized keyword 'host''
I got error when try to apply my tacacs gui configuration, i try this configuration with different server on localhost and it's working but not on my first server tacacs
/opt/tacacsgui/tac_plus.cfg_test:47: Unrecognized keyword 'host'
Please help…

Bemis
- 11
- 2
1
vote
3 answers
Faster way of Awking a file from End to Beginning?
I want to get results starting at the bottom of a file and working my way up to the beginning. I tried using tac and pipe that into my awk command, but its very slow (15 seconds for an 2GB file). Compared to searching normally (3 seconds for the…

Sam
- 113
- 8
1
vote
1 answer
sed and tac: write error: Invalid argument
I'm using GNU Coreutils on Windows. I want to get last error line from log file
The SED regex works fine (but finds first entry in file)
c:\path\sed -n "/70\-Error/{p;q}" MyFile.log
the TAC command
c:\path\tac MyFile.log
successfully reverses the…

Kristen
- 4,227
- 2
- 29
- 36
0
votes
1 answer
xxd vs od - little/big endian or something else going on
I am looking at a compiled java file on Ubuntu 22.04.
On bash, when i say xxd A.class, i get a hexdump that begins with cafe babe - this is what i expect.
But if i say od -x A.class, i get feca beba - why?
As an additional puzzler, both if is say…

bukwyrm
- 186
- 6
0
votes
0 answers
tacacs+ldap+user in several groups
Good day everyone.
There is a tacacs server up on ubuntu with the following config:
id = spawnd {
listen = { address = 0.0.0.0 port = 49 }
spawn = {
instances min = 1
instances max = 10
}
…

Stanislassimus
- 1
- 1
0
votes
0 answers
Which one takes least time to execute bytecode or Three address code
I have a doubt in a question which i was given in an exam. Is there any answer to it, "which one takes least time to execute bytecode or three address code?" I have surfed it all over the net but could not find anything in comparison of them. Kindly…
user16617961
0
votes
0 answers
Unable to read from Jfrog Artifactory
I am attempting to connect to Artifactory to read a Java zip file with the admin user. The call is made through Talend Restful API interface (described below).
Expected result:
To read the file stored in Artifact repository and copy it to a…

st_usr
- 1
- 1
0
votes
1 answer
Annotate last use of variables in (c) source code with (g)awk
I have a file with c Sourcecode such as
func2(&x5, &x6, x4, (arg1[3]));
func2(&x7, &x8, x4, (arg1[2]));
func(&x13, &x14, 0x0, x12, x9);
func(&x17, &x18, x16, x8, x5);
uint64_t x19 = (x18 + x6);
func2(&x20, &x21, x11, 0xff);
func2(&x24,…

Joel
- 1,725
- 3
- 16
- 34