Problem with While Loop in AIX Server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with While Loop in AIX Server
# 8  
Old 11-06-2015
Thanks a lot for your help and providing excellent explaination Smilie

---------- Post updated 11-06-15 at 02:10 PM ---------- Previous update was 11-05-15 at 08:43 PM ----------

Hello,

The code is working fine on RedHat but on AIX it is showing error as shown below:

ksh93[45]: printf: T: unknown format specifier

Could you please help.

Thanks
Rahul
# 9  
Old 11-06-2015
can you show the output of:

Code:
$ oslevel -s
$ ksh93
$ echo ${.sh.version}

# 10  
Old 11-10-2015
Hello agent.kgb,

I am getting desired Output on AIX 7.1. It seems that the ksh93 version is old on AIX5.3

Also Could you please help in converting epoch timestamp from the below file. The 7th field is epoch timestamp :

Code:
78903 0 1 WEEKEND_FULL_ORACLE_BKP Full GYUI-12543 1446541202 0000006420 0000000000 186880
78401 0 1 WEEKLY_FULL_UNIX_BKP Full WEEKLY_TEST 1446508902 0000038818 0000000000 448755456
78306 0 1 WEEKLY_FULL_UNIX_BKP1 Full FTYU-32145 1446455973 0000091647 0000000000 390188288

I am able to convert the 7th field alone but when I am trying to place all the fields in the output report ( 1st to NF fields) then I am getting error. Below command worked

Code:
awk '{print "printf \"%T\n\" \\#"$7}' tmp1.txt | ksh93

Could you please help.

Thanks
Rahul M
# 11  
Old 11-10-2015
Would this work (tested on bash only):
Code:
while read -a A; do printf "%s %s %s %s %s %s %(%F %T)T %s %s %s\n" ${A[0]} ${A[1]} ${A[2]} ${A[3]} ${A[4]} ${A[5]} ${A[6]} ${A[7]} ${A[8]} ${A[9]}; done < file
78903 0 1 WEEKEND_FULL_ORACLE_BKP Full GYUI-12543 2015-11-03 10:00:02 0000006420 0000000000 186880
78401 0 1 WEEKLY_FULL_UNIX_BKP Full WEEKLY_TEST 2015-11-03 01:01:42 0000038818 0000000000 448755456
78306 0 1 WEEKLY_FULL_UNIX_BKP1 Full FTYU-32145 2015-11-02 10:19:33 0000091647 0000000000 390188288

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
Login or Register to Ask a Question