Hi,
If i were to do this an print out the file, it will show as it is in the command
$ awk '/Privilege Use/ {P=0} /Object Access/ {P=1} P' AdvancedAudit.txt
Object Access
File System No Auditing
Registry No Auditing
Kernel Object No Auditing
SAM No Auditing
Certification Services No Auditing
Application Generated No Auditing
Handle Manipulation No Auditing
File Share No Auditing
Filtering Platform Packet Drop No Auditing
Filtering Platform Connection No Auditing
Other Object Access Events No Auditing
Detailed File Share No Auditing
Removable Storage No Auditing
Central Policy Staging No Auditing
However if i were to store the awk in a variable and cat it later it will seems to execute the command. My expected output is the above mentioned.
objectaccess=`awk '/Privilege Use/ {P=0} /Object Access/ {P=1} P' AdvancedAudit.txt`
cat $objectaccess
cat: Object: No such file or directory
cat: Access: No such file or directory
cat: File: No such file or directory
cat: System: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Registry: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Kernel: No such file or directory
cat: Object: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: SAM: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Certification: No such file or directory
cat: Services: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Application: No such file or directory
cat: Generated: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Handle: No such file or directory
cat: Manipulation: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: File: No such file or directory
cat: Share: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Filtering: No such file or directory
cat: Platform: No such file or directory
cat: Packet: No such file or directory
cat: Drop: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Filtering: No such file or directory
cat: Platform: No such file or directory
cat: Connection: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Other: No such file or directory
cat: Object: No such file or directory
cat: Access: No such file or directory
cat: Events: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Detailed: No such file or directory
cat: File: No such file or directory
cat: Share: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Removable: No such file or directory
cat: Storage: No such file or directory
cat: No: No such file or directory
cat: Auditing: No such file or directory
cat: Central: No such file or directory
cat: Policy: No such file or directory
cat: Staging: No such file or directory
cat: No: No such file or directory
: No such file or directory
---------- Post updated at 09:30 PM ---------- Previous update was at 09:24 PM ----------