Re: [SLUG] A LINUX script problem

From: Paul M Foster (paulf@quillandmouse.com)
Date: Sun Dec 12 2004 - 23:30:46 EST


On Sun, Dec 12, 2004 at 11:39:47AM -0500, Eben King wrote:

> On Sun, 12 Dec 2004, Ronald KA4INM Youvan wrote:
>
> > I have numerous "user accounts" on my Slackware computer. (I have only
> > one computer) They are all used only by me, for different reasons. root
> > copies various files to various directories under various accounts
> > (/home/user/ PIX or PDF or DOC etc. )
> >
> > I use script files in mc to range every file in a directory and they
> > change the ownership and attributes for security reasons.
>
> Why use mc? Why not "fild /home/user/{PIX,PDF,DOC} -type f"?
>
> > I can't get the script file to handle filenames with spaces in them,
> > that's the problem. I think using the file manager "mc" is not part of
> > the problem, but I want to use it with mc for the convenience it supplies.
> > Otherwise spaces are no problem for mc.
> >
> > First the usage:
> > mc
> > cd /home/user1
> > *
> > F2
> > cursor up to top entry
> > Enter
> > o
> > Enter
>
> Well, I'm not sure of the exact dialog foxes in mc, and anyhow, they may
> change between versions.
>

MC doesn't really have anything to do with this. It's just the method of
launching the script he's using. The script is where the problem is. The
fact that he's launching a script called "o" which looks for four
command line parameters seems problematic. In mc, the choice he's made
is entitled, "Do something on the current file", and then it gives a
command line, at which he enters "o". MC is going to pass the name of
the current file to that script, which should typically be a single
parameter. If the filename had spaces in it, it might pass the parts
between spaces as additional parameters; I don't know. The double-quote
suggestion might be the best solution. At least worth testing.

Paul
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:38:54 EDT