Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined!
    Join Date
    May 2011
    Posts
    5

    Unhappy 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 .

  2. #2
    Just 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.

  3. #3
    scm
    scm is offline
    Linux 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...