hi
Please find my answers below inline
Is this a homework assignment? If not, how will this information be used?
--> This is part of my project work.Actually I am writing a job , where we can call unix commands also.So my requirement is if I get some n number of input files, I will create same number of reject files with the format sourcefilename.rej. Source file name is in the below format
Party_YYYYMMDD_HHMISSS.txt
so if I have two source files I will have two reject files.
Which UNIX OS are you using?-->
What shell are you using?--> Regarding this I am not sure, as this is not my main tool.Very rarely I use UNIX.
Are there always exactly two files? Are they always named A123.rej & A345.rej? --> Hope the above explanation will answer this question
In what way does your code "not work"? What diagnostics does it produce? When all of your files are empty, what output does it produce? When one or more of your files contain data, what output does it produce? Does it behave differently if there is only one file with a name ending in .rej? --->
I have two rej files like this
Party_20120101_121212.rej
Party_20120101_121214.rej
When I tries to execute the below code I am getting some error.
if [ -s Party*.rej ]
> then
> echo "Data"
> else
> echo "No DATA"
> fi
-bash: [: Party_20120101_121212.rej: binary operator expected
No DATA
My expectation is that, if we have n number of Party*.rej files and if any of the file contains data in it(Data means there should be more than two records in the file, as the row is the header), I need to get echo as "Data"
I am not sure whether this convey my requirement or not. To be frank, I am not very good in UNIX