Sponsored Content
Top Forums Shell Programming and Scripting Problem with While Loop in AIX Server Post 302959634 by rahul2662 on Thursday 5th of November 2015 04:26:10 AM
Old 11-05-2015
Problem with While Loop in AIX Server

Hello,

I am trying to run the following Script on AIX Server. The script checks if first field is EFFECTIVE_TIME , if it is then it converts second field in readable format else it redirects entire line to $MAIL. Both the mentioned files exists prior to running the script

Code:
#!/bin/ksh
MAIL=~/backup_scripts/Changed_Policy_Details.txt
TMP=~/backup_scripts/List_of_Changed_Policies_tmp1.txt
while read line
do
read -a arr <<< $line
if [[ ${arr[0]} == EFFECTIVE_TIME ]];then
a=`perl -le "print scalar(localtime(${arr[1]}))"`
echo ${arr[0]} $a >> $MAIL
else
echo $line >> $MAIL
fi
done < $TMP

The $TMP and $MAIL File exists and the contents of $TMP are as follows :

Code:
Contents of /usr/openv/hpbackup/db/class/serverfgt/info :


ACTIVE 1
EFFECTIVE_TIME 1279345218
GRANULAR_RESTORE_INFO 0


Contents of /usr/openv/hpbackup/db/class/servertyg/schedule/Full/days :


0 13400 21000
1 0 0
2 0 0
3 0 0
4 0 0
5 0 0
6 0 0

Contents of /usr/openv/hpbackup/db/class/serverglt/info :


ACTIVE 0
EFFECTIVE_TIME 1279643561
GRANULAR_RESTORE_INFO 1

I am getting following error from AIX 5.3.

Code:
0403-057 Syntax error at line 4 : `<' is not expected

Could someone please help. I am not getting errors on Red Hat Server but problem only on AIX.

Thanks
Rahul
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

AIX server performance problem!

Hello, I have a performance problem on an AIX box. I'm not sure what is causing this and hoping someone may have suggestions. Currently I'm noticing that cpu's are waiting while the box is in a idle state. I checked the disks and none of them are at 100%. If they were then I would understand... (3 Replies)
Discussion started by: ctcuser
3 Replies

2. AIX

Problem in SSH Install in AIX 4.3 Server.

Hi Friends I am trying to install ssh in one of my AIX4.3 server. I downloaded openssh and openssl from IBM site. While installing them openssh failed. The lpcheck command display looks like this: # lppchk -v lppchk: The following filesets need to be installed or corrected to bring ... (5 Replies)
Discussion started by: efunds
5 Replies

3. AIX

how to loop through non-empty files with shell script on AIX

I have av script that loops through some statistic files to create a report. We would like to only loop through non-empty files as these files create an empty report-line. I have figured out how to find the non-empty files, but not how to loop through only those files. Here is the code that finds... (4 Replies)
Discussion started by: Tessa
4 Replies

4. AIX

Transferring files from one AIX server to another AIX server in binary mode

Hi, I am a newbie to AIX. We have 2 AIX5.3 servers in our environment, I need to transfer some files in Binary mode from one server to another and some files in ASCII mode from one server to another server. Could you please help me as to how I need to do that? Thanks, Rakesh (4 Replies)
Discussion started by: rakeshc.apps
4 Replies

5. Shell Programming and Scripting

Send email from sendmail on AIX using exchange server as SMTP server

i am new in AIX i am trying to write a script to take a backup for specific files on server to and check error log if backup success send email to administrator , script done except for sending mail , i try to configure sendmail on aix to use our exchange server to send emails but still get error... (0 Replies)
Discussion started by: ahmed_salah
0 Replies

6. Shell Programming and Scripting

Aix .ksh for loop script.

Hi, I'm trying to write a for loop to run through a list of servers and for each server copy a file to a backup file. But I can't seem to get it to run through my server list. It work for individual servers, please see below. #!/bin/ksh SSH_USERID=khcuser webservers="server1 server2" ... (2 Replies)
Discussion started by: elmesy
2 Replies

7. Programming

Problem with Perl script after moving from a Windows/Apache Server to a UNIX server.

I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning. The script is called cwrmail.pl and is located in my cgi-bin. When I... (9 Replies)
Discussion started by: BigBobbyB
9 Replies

8. AIX

Virtual I/O server Problem (before Installing AIX 7.1)

Hello people, I'm facing some problems Installing AIX in my Power server 720 Well, to tell the truth my problem is in Virtual I/O (IVM) installation. OBSERVE THAT I DON'T HAVE A HMC! By the way: I have the latest server Firmware! I've done all the process in ASMI, then inserted and... (1 Reply)
Discussion started by: Xscaio
1 Replies

9. AIX

Will it affect my AIX LPAR security, when i set up email alerts on AIX server.

Hello, I've set up email alerts on AIX Servers. so that i can get email notifications (via mail relay server) when ever there is abnormal behavior. for example 1) my script monitors CPU/disk/memory etc... when it reaches high water ark, it will send an email alert. 2) disk usage alerts 3)... (5 Replies)
Discussion started by: System Admin 77
5 Replies

10. AIX

How to ssh from an AIX OS server to a Fabric OS server without password?

Hi I'd like to ssh from an AIX OS server ( v5.3) to a Fabric OS server ( v6.1.2 ) without password. I tried using dsa or rsa keys but it didn't work, the aix server still asked for the password. Somebody help, please :(:(:( (8 Replies)
Discussion started by: bobochacha29
8 Replies
UPGRADEDB(8)						      System Manager's Manual						      UPGRADEDB(8)

NAME
upgradedb - Directory Server script for upgrading the database SYNOPSIS
upgradedb [-a archivedir] [-Z serverID] [-f] [-v] [-d debuglevel] [-h] DESCRIPTION
Checks the DB version and if it has the old index formatting then it will rebuild the indexes. This is usually needed after migrating from older versions of Directory Server. This script must be run while the server is stopped. OPTIONS
A summary of options is included below: -n Backend Name The name of the LDBM database to reindex. Example: userRoot -a Database directory The full path to the database directory. -Z Server Identifier The server ID of the Directory Server instance. If there is only one instance on the system, this option can be skipped. -N Only checks whether any DNs in the database need to be updated. -h Display the usage. EXAMPLE
upgradedb -Z instance2 DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a non-zero exit status and a diagnostic message being written to standard error. AUTHOR
upgradedb was written by the 389 Project. REPORTING BUGS
Report bugs to http://bugzilla.redhat.com. COPYRIGHT
Copyright (C) 2013 Red Hat, Inc. Mar 5, 2013 UPGRADEDB(8)
All times are GMT -4. The time now is 03:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy