On 22 May 2012, at 16:15, Bernhard Rohrer wrote:
> may I ask for help with bash again please? I have a .jar that when told to work on * only works on the first file in the directory. Can anybody suggest a simple way to make it munch through the whole directory?
When you issue a command line such as
the executable WHATEVER is searched for along the path, and then called with whatever * expands to in the current directory (and current bash versions may pass a literal * to the app. if no match is found).
If your jar only process the first file, this means that it doesn't have internal logic to process more than one command line argument (though it could conceivably do its own wild card expansion - what happens if you pass it '*' ?)
Presuming that this doesn't work, the way to handle it with bash is
for arg in *; do WHATEVER $arg;done
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!