Asset Management Suite

 View Only
  • 1.  Looking for a generic script to search UNIX\Linux txt files for a string on SMP 7.1

    Posted Nov 14, 2012 07:41 AM

    I was wondering if anyone had a generic UNIX\Linux script on SMP 7.2 Inventory Solution that they had already tested that would search for a specific file and then search for a specfic string returning either that line or the whole file (or some variation of this that's easily tweaked!)



  • 2.  RE: Looking for a generic script to search UNIX\Linux txt files for a string on SMP 7.1

    Posted Nov 20, 2012 04:15 PM


  • 3.  RE: Looking for a generic script to search UNIX\Linux txt files for a string on SMP 7.1

    Posted Nov 29, 2012 05:50 AM

    Thanks.

    I didn't really mean the contents of the file just the filename and say, path.

    It is just the 1 line I would be looking for.

    So in the example of 'client.conf' I was looking for generic scripts that would search for the file first and where present

    (1) Search for the string 'Server-1' and return that line if found or even simpler

    (2) Search for the string 'Server-1=servername.domain.com and return a TRUE

     

    e.g.
    # This is the Altiris Server name agent is working with.
    Server-1=servername.domain.com

    #

    Is this similar to the scripts you've written before ............?