Yes you are 100% right .. It is testing a different thing and I never realized ls would return 1 if one of files is not present even if all the other ones are..
---
full shell solution (without line length limitations):
Last edited by Scrutinizer; 04-25-2016 at 08:40 AM..
conditional is not wworking
can any one figure out what goes wrong
xx1=`$ORACLE_HOME/bin/sqlplus -s apps/ostgapps1 2>/dev/null << EOF
WHENEVER SQLERROR EXIT 1
set head off feedback off ;
WHENEVER SQLERROR EXIT SQL.SQLCODE;
select count(*) from CMS_INVOICE_ALL... (2 Replies)
Hi,
I am new to unix and shell scripting.In my script,there is a line using the "if" conditional -
if && ; then
do something
Here "x" is a variable holding string value.If it is not equal to a comma or a string,only then I want to enter the "if" loop. But I am getting error while... (1 Reply)
Hi,
I am new to unix and shell scripting.In my script,there is a line using the "if" conditional -
if && ; then
do something
Here "x" is a variable holding string value.If it is not equal to a comma or a string,only then I want to enter the "if" loop. But I am getting error while... (12 Replies)
Hi,
I need to extract lines based on some conditions as explained below:
File format details:
1. each set starts with AAA only
2. number of columns is fixed
3. number of rows per set may vary (as one set is upto DDD - 4 rows)
Now, i need to extract only the lines starting with AAA and... (2 Replies)
I need a shell script that will monitor a few conditions and not execute until the these conditions are met. The problem I'm having is that I can not perform a database snapshot (backup) of a sybaseIQ database unless the CPU Status Idle % is above 60% or the snapshot (backup) fails.
If... (2 Replies)
I want to add a conditional statement to a user's .profile file. I have a certain number of users that log in and use the rksh (Restricted Korn Shell). When they log in, it starts a certain program and when they exit this program, the system logs them out. When they are in this program, they can... (2 Replies)
Hi,
I want to perform a conditional search and remove my search string.
Input string: "abcdaabcadgfaarstab"
Character to search: "a"
Condition: Remove all "a" in the input string except if it is "aa"
Output string: "bcdaabcdgfaarstb"
Can you please help me in this? (5 Replies)
Hi,
I have one array created and some values are there in ksh. I want to append some other values to it based on some condition in if statement.
#!/bin/ksh
echo "---------------------------------------------------"
set -A ipaddr_arr $(egrep -v '^#|^::|^$' /etc/hosts |awk '{print $1}'... (2 Replies)
Greetings,
I need help in splitting the files in an efficient way while accommodating the below requirements . I am on AIX.
Split condition
Split the file based on the record type and the position of the data pattern that appears on the on the record type.
Both record type and and the... (9 Replies)
Hi everyone,
I need to replace values of column 2 array1 with values of column 2 array2 based on a lookup of column 4 value, but only return a value IF the values in column 1 of BOTH array1 and array2 match, otherwise keep original value in column 2 of array1. Both files are tab delimited... (2 Replies)