Skip to content

can not get an ls /directory/subdir | tail -1 to execute

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
  • paulschiele Offline
  • Posts: 1
  • Joined: Fri Aug 23, 2013 12:49 pm

can not get an ls /directory/subdir | tail -1 to execute

Post by paulschiele »

In Director version 4.6.1 I can't seem to get the right syntax to execute a the below native command in Linux. I have tried several different ways of splitting this up into varialbes in seperate arguments etc. etc. to no avail.

ls /directory/subdir | tail -1

config is as follows:
EXEC TASK - eXECUTABLE* = LS
arg: /directory/subdir | tail -1

Returns this error:
5/29/15 11:23:40 AM INFO Preparing to execute the native command 'ls' with the argument(s) '/directory/subdir/inbound | tail -1'
5/29/15 11:23:40 AM INFO ls: cannot access /directory/subdir/inbound | tail -1: No such file or directory
5/29/15 11:23:41 AM INFO The native command 'ls' finished with a return code of '2'
5/29/15 11:23:41 AM ERROR [9003 - exec] The executable encountered an error with a return code of '2'. To ignore this error, set the attribute 'errorIfExecutableFails' to false.

Thanks,
Paul
  • Support_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: can not get an ls /directory/subdir | tail -1 to execute

Post by Support_Rick »

While GoAnywhere Director provides a way to execute a native command on the local system, “piping” in a command string in Linux is not supported. This pipe “|” function is actually two commands, the result of the first serves as the input for the second. In technical terms, these are two threads. To accomplish the same result, the first command (before the “|”) can be executed with the Execute Native Command task, then the results used in a second Execute Native Command task.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Post Reply