I have a 'sed' editor command trying to read contents of one file into another.
v=t1
PX=25
sed '/for/ r /$v/ext/tsfirmfiles.${PX}' /bb/bin/px${PX}.files.2b.deleted > result
I cannot come up with the syntax so 'sed' would do a variable substitution.
Any idea? Thanks a for help. -A (1 Reply)
Hello,
i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem.
my var1 is a string constructed like this:
filename1 filerev1 filepath1
my var2 is another string constructed like this:
filename2 filerev2 filepath2
when i do... (2 Replies)
Hi,
I am facing a strange problem. I have a script that used the following to search and replace text:
sed 's/'"${find_var_parm}"'/'"${find_var_filter}"'/g' $ParmFile > $TempFile
The values of $find_var_parm and $find_var_filter are set based on search criteria. The above seems to be working... (2 Replies)
Hi,
I have to insert a line at a particular line number in my file. But the line number is not fixed and it will vary every time. So, I have to use a variable to get the line number
I know we can use sed to insert lines at a particular line number but it does not work with variable... (3 Replies)
Give the code:
set line = 2
set year = `sed -n '2p' file
while ($line < 500)
echo $line > f.txt
@ line = $line + 1
end
How do I utilize the variable $line in the code instead of the number 2. I'm using this in a while loop and counter. I've tried quoting it, double/single... (1 Reply)
Hello, I searched the forum and unable to find a solution for my particular problem. I have a text file I'm trying to insert some text using sed after finding a pattern..
File contains in one line
Invoice date: xx/xx/xxxx Balance: $$$$ Name: xxxxxxxxxxxxxx
Trying to insert Invoice "Number:... (3 Replies)
Problem with the code below is that the value of the variable is not getting substituted in the sed expression.
#/bin/csh
set UNIX_ID="rajibd"
set X_ID="xrajibd"
sed -n 's/$UNIX_ID/$X_ID/g' passwd
When run , it is not giving expected output as shown below :
... (4 Replies)
Hi I am trying to do the following in a script find a string and add in a block of text two lines above on the command line this works fine
#/usr/bin/cat /usr/local/etc/dhcpd.conf_subnet | /usr/xpg4/bin/sed -n -e '1h;1\!H;${;g;s/}.*#END of 10.42.33.0/#START of RANGE $dstart\:option... (3 Replies)
I'm trying to change "F" to "G" in lines after the first one:
'FUE.SER' 5
1 1 F0501 F0401 F0502
2 1 F0301 E0501 F0201 E0502 F0302
3 1 F0503 E0503 E0301 E0201 E0302 E0504 F0504
4 1 F0402 F0202 E0202 F0101 E0203 F0203 F0403
5 1 F0505 E0505 E0303 E0204 E0304 E0506... (10 Replies)
Discussion started by: larrl
10 Replies
LEARN ABOUT CENTOS
aureport
AUREPORT:(8) System Administration Utilities AUREPORT:(8)NAME
aureport - a tool that produces summary reports of audit daemon logs
SYNOPSIS
aureport [options]
DESCRIPTION
aureport is a tool that produces summary reports of the audit system logs. The aureport utility can also take input from stdin as long as
the input is the raw log data. The reports have a column label at the top to help with interpretation of the various fields. Except for the
main summary report, all reports have the audit event number. You can subsequently lookup the full event with ausearch -a event number. You
may need to specify start & stop times if you get multiple hits. The reports produced by aureport can be used as building blocks for more
complicated analysis.
OPTIONS -au, --auth
Report about authentication attempts
-a, --avc
Report about avc messages
-c, --config
Report about config changes
-cr, --crypto
Report about crypto events
-e, --event
Report about events
-f, --file
Report about files
--failed
Only select failed events for processing in the reports. The default is both success and failed events.
-h, --host
Report about hosts
--help Print brief command summary
-i, --interpret
Interpret numeric entities into text. For example, uid is converted to account name. The conversion is done using the current
resources of the machine where the search is being run. If you have renamed the accounts, or don't have the same accounts on
your machine, you could get misleading results.
-if, --input file
Use the given file instead of the logs. This is to aid analysis where the logs have been moved to another machine or only part of a
log was saved.
--input-logs
Use the log file location from auditd.conf as input for analysis. This is needed if you are using aureport from a cron job.
-k, --key
Report about audit rule keys
-l, --login
Report about logins
-m, --mods
Report about account modifications
-ma, --mac
Report about Mandatory Access Control (MAC) events
-n, --anomaly
Report about anomaly events. These events include NIC going into promiscuous mode and programs segfaulting.
--node node-name
Only select events originating from node name string for processing in the reports. The default is to include all nodes. Multiple
nodes are allowed.
-p, --pid
Report about processes
-r, --response
Report about responses to anomaly events
-s, --syscall
Report about syscalls
--success
Only select successful events for processing in the reports. The default is both success and failed events.
--summary
Run the summary report that gives a total of the elements of the main report. Not all reports have a summary.
-t, --log
This option will output a report of the start and end times for each log.
--tty Report about tty keystrokes
-te, --end [end-date] [end-time]
Search for events with time stamps equal to or before the given end time. The format of end time depends on your locale. If the date
is omitted, today is assumed. If the time is omitted, now is assumed. Use 24 hour clock time rather than AM or PM to specify time.
An example date using the en_US.utf8 locale is 09/03/2009. An example of time is 18:00:00. The date format accepted is influenced by
the LC_TIME environmental variable.
You may also use the word: now, recent, today, yesterday, this-week, week-ago, this-month, this-year. Today means starting now.
Recent is 10 minutes ago. Yesterday is 1 second after midnight the previous day. This-week means starting 1 second after midnight on
day 0 of the week determined by your locale (see localtime). This-month means 1 second after midnight on day 1 of the month.
This-year means the 1 second after midnight on the first day of the first month.
-tm, --terminal
Report about terminals
-ts, --start [start-date] [start-time]
Search for events with time stamps equal to or after the given end time. The format of end time depends on your locale. If the date
is omitted, today is assumed. If the time is omitted, midnight is assumed. Use 24 hour clock time rather than AM or PM to specify
time. An example date using the en_US.utf8 locale is 09/03/2009. An example of time is 18:00:00. The date format accepted is influ-
enced by the LC_TIME environmental variable.
You may also use the word: now, recent, today, yesterday, this-week, this-month, this-year. Today means starting at 1 second after
midnight. Recent is 10 minutes ago. Yesterday is 1 second after midnight the previous day. This-week means starting 1 second after
midnight on day 0 of the week determined by your locale (see localtime). This-month means 1 second after midnight on day 1 of the
month. This-year means the 1 second after midnight on the first day of the first month.
-u, --user
Report about users
-v, --version
Print the version and exit
-x, --executable
Report about executables
SEE ALSO ausearch(8), auditd(8).
Red Hat Sept 2009 AUREPORT:(8)