Results 1 to 3 of 3
Hello there,
Guys I've got an issue and I need a hint...I have to create a sh script which parse /etc/syslog.conf file (under solaris) and need to get all path ...
- 05-25-2011 #1Just Joined!
- Join Date
- May 2011
- Posts
- 5
parse /etc/syslog.conf file
Hello there,
Guys I've got an issue and I need a hint...I have to create a sh script which parse /etc/syslog.conf file (under solaris) and need to get all path accordingly to all logs configured in there.
If anybody knows more about this please let me know. Thanks .
- 05-26-2011 #2Just Joined!
- Join Date
- Feb 2007
- Location
- Cobleskill, NY
- Posts
- 51
Is the file from Solaris to be parsed in Linux or a Linux file to be parsed in Solaris? Just to make it clear what tools are available and what paths that may be encountered since they aren't exactly the same.
- 05-31-2011 #3Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Easiest way to get the paths is to extract the last field from any line that's not empty or a comment:
awk '/^ *$/ {next}
/^#/ {next}
{print $NF}' /etc/syslog.conf


Reply With Quote