How to run commands with wildcards (“ls *”) from external command activity.

How to run commands with wildcards (“ls *”) from external command activity.

book

Article ID: KB0085745

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Description:
============
On UNIX systems, commands such as  “ls *” and “tar -cf tarred.tar *” can work fine in Console mode. But with BW External Command activity, commands such as “ls *” will return output such as  “Output from Test Unix Command 2 *: No such file or directory”. The command “tar -cf tarred.tar *” will return output such as “Output from Test Unix Command 1 Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqvw[0-7]][bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...”

Environment:
===========
OS: UNIX/Linux
TRA: ALL
BW: ALL

Cause:
=====
This is not a BW or Java defect/limitation. Wildcards such as "*" are not supported by the  ls  or  tar  commands themselves, but by the UNIX/Linux shell.

Resolution:
==========
Use non wild carded commands such as '/bin/sh -c "tar -cf test.tar *"‘or "'/bin/sh -c "ls *"' . Also, make sure to check "Remove Parameter Quotes" in External Command->Configuration

Issue/Introduction

How to run commands with wildcards (“ls *”) from external command activity.