My requirement is to check wheather some csv files have mandatory columns value as empty if empty log a error message or set a flag.
The problem here is that the column number varies for different CSVs hence we can not hardcode $1 or $3 like this in the awk command hence we are reading a proprty file to get the mandatory fields & then setting it to a variable by prefixing $ to that column number & checking the empty value for that column.
I am writing the following awk command :
It works well in ksh shell of Unix but in AIX it fails with error : Then we found out that '{ if( 'is creating problem as AIX is treating this as command for awk if I can get a solution to retreive the $COL_NUMBER as $1 then my problem will be solved. as $COL_NUMBER contains $1 or $2 something like this.
I move your thread into the shell scripting area, as this is not really AIX specific as more a type of shell/awk and might have better chances for an answer.
Please try this:
The outer for loop can be actually omitted also, with awk doing the grep and extracting the column numbers, but this may be more comprehensive approach. Instead of making awk print a statement into stdout, you can print it into a file, and then check whether the file is empty, if not, then some columns in some files contained errors and take appropriate measures.
I am running AIX 7.1 and currently we have samba 3.6.25 installed on the server. As it stands some AIX folders are shared that can be accessed by certain Windows users.
The problem is that since Windows 10 the guest feature no longer works so users have to manually type in their Windows login/pwd... (14 Replies)
I'm using the below statements in my script
if && then
sqlplus sysadm/abcdefgh12@${dbarr} @/u1/scripts/ResetPswd.sql
elif then
for idx in 0 1 2 3 4 5 6 7
do
sqlplus sysadm/abcdefgh12@${dbarr} @/u1/scripts/ResetPswd.sql
done
else
exit
fi
It give me... (5 Replies)
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)
HI
My doubt may be basic one but I need to get it clarified..
When i use "if" condition that checks for many AND, OR logical conditions
like
if ]; then
return 0
fi
Even the if condition fails it returns as zero.. Any clue..
But if i add else condition like
if ]; ... (2 Replies)
Using nimadm:
nimadm -j nimadmvg -c sap024 -s spot_6100 -l lpp_6100 -d "hdisk1" -Y
Initializing the NIM master.
Initializing NIM client sap024.
0505-205 nimadm: The level of bos.alt_disk_install.rte installed in SPOT
spot_6100 (6.1.3.4) does not match the NIM master's level (7.1.1.2).... (2 Replies)
hi,
I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command
Here are my simple script
After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Executed the following if conditions .. and got different results .
only (( )) gave correct o/p with all scenarios .
Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition.
And why each condition gave different result.
1.... (2 Replies)
Is it necessary to put system into single user mode for applying aix 5.3 TL8 on a aix 5.3.5.0 system ?
Is the TL8 installation not totally safe ?
thank you. (6 Replies)