Page 1 of 1

ls -m behaving strangely

Posted: Tue Sep 08, 2009 7:27 pm
by Novak
Hi all,

I was hoping somebody would have come accross this very strange behaviour of 'ls -m' command executed from the Execute Command stage and is able to help me.
There is a list of files in DEV environment that I want to retrieve that are meant to be delimited by commas and later handled by a loop. The problem arises when the list of files is produced but no commas are included. This proven by the output that can be seen in Director's log of the job. The following loop does what its meant to and processes 1 file only (had the commas been included it would process them all).
Whats strange is that when the actual command 'ls -m' (parameters replaced by values) is copied from director and executed on Unix, the list of files with commas included is the resulting output.
Whats more strange even, is that this exact same job is run on 2 other environments (SIT and UAT on a different unix box to DEV) and it works like a clock.
I know it would be possible to consider some of the other delimiters to solve this small problem, but it is only the DEV box this is not working on and as mentioned before we have it functioning on the subsequent environments. It is just that it is intriguing and I would not mind knowing what could possibly cause this?

Thanks & Regards,

Novak

Posted: Tue Sep 08, 2009 8:33 pm
by ray.wurlod
Does your command use any quote characters and, if so, of what kind? Can you post the complete command and parameters fields from your Execute Command activity?

Posted: Tue Sep 08, 2009 9:31 pm
by chulett
Have you involved your SysAdmins, the ones responsible for the O/S on those boxes? And please post the complete log entry which shows the command being executed.

Posted: Tue Sep 08, 2009 10:24 pm
by laknar
Convert The Filed Mark Value in a user variable activity

Code: Select all

Convert(@FM,"",ExecuteCommand.$CommandOutput) 

Posted: Wed Sep 09, 2009 2:12 am
by Novak
Hi,
Can you post the complete command and parameters fields from your Execute Command activity?
It is a no Ray, no quote characters. This is the actual command copied from Director:

ls -m /apps/etl/dev/datainput/archive/reference_data/80241_*.dsv
Have you involved your SysAdmins, the ones responsible for the O/S on those boxes? And please post the complete log entry which shows the command being executed.
The answer to involving SysAdmins is no Chullet. Have not gone anywhere yet. Just tried to extensively test this.
The result from running the above command is as:

/apps/etl/dev/datainput/archive/reference_data/80241_Employee_20090907_164221.dsv
/apps/etl/dev/datainput/archive/reference_data/80241_General_Calendar_20090907_164223.dsv
/apps/etl/dev/datainput/archive/reference_data/80241_Global_Parameter_20090907_164229.dsv

The above is just the small part of all the files that get listed, but as you can see the delimiting comma between them is missing. Small reminder - the exact copy of the job working fine in the subsequent environments.

Thanks,

Novak

Posted: Mon Sep 14, 2009 11:50 pm
by Novak
Guys,

Hopefully, nobody ever gets this same issue because I found it impossible to resolve. Since I posted last, the scenario is completely different with respect to the environments. All of sudden (for the reasons unknown to anybody) the job is working in DEV, but is not working in SIT.
So, instead of fearing this same scenario in future, I changed command from 'ls -m' to 'ls -1' (column listing) and handled the output in a later stage by converting @FM to a comma.

Regards,

Novak

Posted: Tue Sep 15, 2009 5:34 am
by chulett
That is extremely odd but at least you have a workaround. :?