[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [ in /usr/bin Question



Douglas Allan Tutty wrote:
On Wed, May 09, 2007 at 09:00:58AM -0700, Bob McGowan wrote:
bdeferme wrote:
Tom Grove <debian@voidmain.net> wrote:

Hello all...I am new to this Debian thing :-)  I used it in the Woody
days but moved over to the FreeBSD world for the last few years.  I
recently installed Testing (Lenny) and see the left bracket in my
/usr/bin directory and do not know what it is.  When I ls -al it I get:

<---deleted content--->

  dpkg -S '/usr/bin\['

is much easier to read (and type correctly), than

  dpkg -S /usr/bin/\\\[


No wonder I can never figure out what a shell script is trying to do,
either way it looks like a cat on a keyboard.  Give me python and
fortran77 any day.

Doug.


As I don't use python, I have no direct experience here. I do use Perl, however. It is also 'easier' than the shell, assuming you put the script in a file.

So, a question: Can python 'run' code directly from the command line, as Perl does with the -e option?

   perl -e 'while(<>){print}'

for example. If so, you'd have the same quoting issues you have with a shell script, since you would need to protect the python part of the input from shell interpretation.

Since the shell is both a command interpreter (runs other applications) and a programming language, it gets very complicated when it is working with another program that also uses wild cards or regex or simply general programming language constructs like parens or braces.

Putting things in a file makes things even easier, assuming the program in question will read files (as Perl, python, awk, C, Fortran, Pascal ..., do). Unfortunately, this doesn't help a lot with the shell, the same problems exist in the shell script file as exist on the command line.

Bob

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Reply to: