Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • On Linux, "less" can handle both:

    less dir/

    less file.txt

    However, on the FreeBSD machines I use, "less" can't handle directories, so I don't depend on it for that.

    • less dir/ only works for me when $ENV{LESSOPEN} is set to an appropriate script, regardless of Linux or BSD.
  • cat spews junk? All I get is

    $ cat .
    cat: .: Is a directory

    Btw, blindly typing reset + Enter on a screwed terminal will often fix it.

    • The reset command breaks my backspace key, though. I could probably source my .bashrc as I think I have something in there to fix it, but I can't recall.

    • Linux typically generates errno=EISDIR on open(".", O_WRONLY) and read(dirfd, …).  IIRC, the latter varies by filesystem on BSD.
  • I don't know about swapping but my (z)shell alias 'm' handles directories (ls -sF | less) and files (less), and for certain types of files it does Magic (TM), e.g. for .tar.bz2 it pipes bzip2 -d foo.tar.bz2 | tar tvf - to less (I don't do tar jtvf because I don't have gtar everywhere). Kinda like open(1) in Mac OS X.