On Mon, 19 Sep 2011 11:15:08 +0700, Ivan wrote in message
86fwjtp3qr@gray.siamics.net:
The following message is a courtesy copy of an article
that has been posted to comp.unix.shell as well.
Arnt Karlsen a...@c2i.net writes:
On Fri, 16 Sep 2011 00:17:47 +0700, Ivan wrote:
On Fri, 16 Sep 2011 00:17:47 +0700, Ivan wrote in message
86ehzhsp1g@gray.siamics.net:
Whitespace is not a problem as long as one remembers to
double-quote Shell $ubstitutions, like:
for i in a b c ; do
..or, e.g.: for i in $(ls /path/to/files/*.txt ) ; do
txt2pdf
The following message is a courtesy copy of an article
that has been posted to comp.unix.shell as well.
Arnt Karlsen a...@c2i.net writes:
On Fri, 16 Sep 2011 00:17:47 +0700, Ivan wrote:
[Cross-posting to comp.unix.shell for no good reason at all.]
Whitespace is not a problem as long
Hi,
in some directory it has some files, let's say:
a.txt b.txt c.txt d.txt
I want to run a command, suppose it's
txt2pdf -input a.txt -output a.pdf
what if I want to do like
txt2pdf -input *.txt -output *.txt
I tried in bash,
use
for i in a b c
do
txt2pdf -input i.txt -out i.pdf
done
my
Sorry for so many trivial description before.
the Q can be simplified as:
mv *.txt *.pdf
can it be done * way?
all the *.txt in current directory?
Thanks,
On Thu, Sep 15, 2011 at 11:58 PM, lina lina.lastn...@gmail.com wrote:
Hi,
in some directory it has some files, let's say:
a.txt
On Fri, Sep 16, 2011 at 12:07 AM, Aaron Toponce aaron.topo...@gmail.comwrote:
On Fri, Sep 16, 2011 at 12:03:40AM +0800, lina wrote:
mv *.txt *.pdf
can it be done * way?
all the *.txt in current directory?
Yes. Checkout the rename(1) command. It comes from Perl, and can be used
for
lina:
for i in a b c
do
txt2pdf -input i.txt -out i.pdf
done
You almost nailed it:
for i in a b c ; do
txt2pdf -input ${i}.txt -out ${i}.pdf
done
Instead of listing the files manually, you can use '*' as a wildcard.
But that only works if your filenames don't contain whitespace. A more
On Fri, Sep 16, 2011 at 12:12 AM, Jochen Spieker m...@well-adjusted.dewrote:
lina:
for i in a b c
do
txt2pdf -input i.txt -out i.pdf
done
You almost nailed it:
for i in a b c ; do
txt2pdf -input ${i}.txt -out ${i}.pdf
done
Instead of listing the files manually, you can use
On Thu, Sep 15, 2011 at 10:07:16AM -0600, Aaron Toponce wrote:
On Fri, Sep 16, 2011 at 12:03:40AM +0800, lina wrote:
mv *.txt *.pdf
can it be done * way?
all the *.txt in current directory?
Yes. Checkout the rename(1) command. It comes from Perl, and can be used
for exactly that.
On Fri, Sep 16, 2011 at 12:16 AM, Aaron Toponce aaron.topo...@gmail.comwrote:
On Thu, Sep 15, 2011 at 10:07:16AM -0600, Aaron Toponce wrote:
On Fri, Sep 16, 2011 at 12:03:40AM +0800, lina wrote:
mv *.txt *.pdf
can it be done * way?
all the *.txt in current directory?
Yes.
On Fri, Sep 16, 2011 at 12:27 AM, Axel Freyn axel-fr...@gmx.de wrote:
On Thu, Sep 15, 2011 at 10:07:16AM -0600, Aaron Toponce wrote:
On Fri, Sep 16, 2011 at 12:03:40AM +0800, lina wrote:
mv *.txt *.pdf
can it be done * way?
all the *.txt in current directory?
Yes. Checkout
On Fri, Sep 16, 2011 at 12:47:11AM +0800, lina wrote:
You have options.
Just some additional remarks:
a) the for-loop won't work, as FILE is expanded to the name including
the .txt, so if you have a file a.txt this loop will execute
mv a.txt.txt a.txt.pdf
You need
Jochen Spieker m...@well-adjusted.de writes:
lina:
for i in a b c
do
txt2pdf -input i.txt -out i.pdf
done
You almost nailed it:
for i in a b c ; do
txt2pdf -input ${i}.txt -out ${i}.pdf
done
Instead of listing the files manually, you can use '*' as a wildcard.
But that
Axel Freyn axel-fr...@gmx.de writes:
[…]
So you should try e.g.
for FILE in *.txt; do mv $FILE `basename \$FILE\ .txt`.pdf; done
Backticks are obsolete for a long time, and that's precisely the
reason. Consider how much cleaner is the following:
for FILE in *.txt; do
lina:
On Fri, Sep 16, 2011 at 12:12 AM, Jochen Spieker m...@well-adjusted.dewrote:
but the situation is a bit different,
here we have .txt file and also .log files
and only .txt files are expected to convert,
It would help if you didn't change the specifications. :) Nevertheless,
you can
15 matches
Mail list logo