Join all text files in a folder, with a single line of Ruby code

# I often use -ep to get rid of quotes and "unused literal"
# warning.

i just tried that nobu, but it gives no output

:~$ ruby -ep *.txt
:~$

···

From: Nobuyoshi Nakada [mailto:nobu@ruby-lang.org]

Hi,

At Mon, 27 Oct 2008 16:10:31 +0900,
Peña, Botp <botp@delmonte-phil.com> wrote in [ruby-talk:318654]:

i just tried that nobu, but it gives no output

:~$ ruby -ep *.txt

You needs -p option.

  ruby -pep *.txt

···

--
Nobu Nakada

# At Mon, 27 Oct 2008 16:10:31 +0900,
# Peña, Botp <botp@delmonte-phil.com> wrote in [ruby-talk:318654]:
# > i just tried that nobu, but it gives no output
# >
# > :~$ ruby -ep *.txt

···

From: Nobuyoshi Nakada [mailto:nobu@ruby-lang.org]
#
# You needs -p option.
#
# ruby -pep *.txt

you're saying -ep is different from -e -p ?
i'm asking since i do not see it ruby -h

thanks for the info -botp

Hi,

At Mon, 27 Oct 2008 19:22:57 +0900,
Peña, Botp <botp@delmonte-phil.com> wrote in [ruby-talk:318662]:

# > i just tried that nobu, but it gives no output
# >
# > :~$ ruby -ep *.txt
#
# You needs -p option.
#
# ruby -pep *.txt

you're saying -ep is different from -e -p ?
i'm asking since i do not see it ruby -h

Each -e needs a following expression, so 'p' after it is
Kernel#p, however, -p doesn't take arguments so 'e' after it is
-e.

···

--
Nobu Nakada

Thanks for all replies. A lot of interesting solutions!

www.twitter.com/luisbebop

dumb me. all the time i thought the quotes were required for -e and
that a space should separate it fr the expression :))
so now even "ruby -pe0 *.txt" should work!

many thanks for the englightenment, nobu.
kind regards -botp

···

on Mon, Oct 27, 2008 at 8:17 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:

Each -e needs a following expression, so 'p' after it is
Kernel#p, however, -p doesn't take arguments so 'e' after it is -e.