AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
  • 1.  Writing simple unix scripts , help me ?

    Posted Fri July 26, 2013 02:04 PM

    Originally posted by: sidharth2009


    I want to start learning , writing simple unix script , help me ?
    where to find a guidelines or basic steps for it

    My need is : am looking for a unix script which
    should print content of a file(file contains version info) ,
    This file is be located
    in the same location ex: $ORACLE_HOME/Version.txt on different hosts or servers ex: 25 hosts or Servers.
    But these hosts or servers can be on HP unix, AIX , or Sun.

    My Goal is : Instead of logging to each host or server and Checking the
    Version details in $ORACLE_HOME/Version.txt , I want to automate it with a script.
    The script should be able print the Version Information for these all 25 hosts or Servers.

    How to write and from where to execute.


    #AIX-Forum


  • 2.  Re: Writing simple unix scripts , help me ?

    Posted Sat July 27, 2013 10:31 PM


  • 3.  Re: Writing simple unix scripts , help me ?

    Posted Mon July 29, 2013 03:28 AM

    Originally posted by: sidharth2009


    Hi Floodstrom

    Thanks for response and reply  :)

    Will Go through it

    Regards

    Any other Suggestions for me ...For the step by step learning


    #AIX-Forum


  • 4.  Re: Writing simple unix scripts , help me ?

    Posted Mon July 29, 2013 10:19 AM

    Originally posted by: GarlandJoseph


    I would suggest using ssh and running this script from one SOURCE machine.  I would transfer the public key to each of the target servers so that the SOURCE machine would not have to specify the pass word and could simply do something like

    scp  user@targetmachine:$ORACLE_HOME/Version.txt targetmachine_version.txt

    or

    ssh user@targetmachine cat $ORACLE_HOME/Version.txt.

    If you don't have ssh then you could create an expect script that could supply the password instead of setting up ssh keyed access.  You could also automate ftp using a .netrc script to ftp the file from the target machines.

    Note:  "user@targetmachine" implies that the SOURCE machine has placed it's ssh public key in that user's .ssh directory on the target machine.


    #AIX-Forum