I have a function defined in my .bashrc as:
function lf { /bin/ls -l | grep ^- ; }
It prints the files in the CWD without listing other directories.
Suppose I want to 'chmod 600' all the files in the CWD without affecting
directories, I try this:
chmod 600 `lf`
but I get this error:
chmod:
Incoming from Pollywog:
I have a function defined in my .bashrc as:
function lf { /bin/ls -l | grep ^- ; }
It prints the files in the CWD without listing other directories.
Suppose I want to 'chmod 600' all the files in the CWD without affecting
directories, I try this:
chmod 600
On Sunday 08 May 2005 04:52 pm, s. keeling wrote:
You're passing it /bin/ls -l instead of /bin/ls. -l works in the
function to pick up files only, but fails in chmod (you can't chmod 600
-rw-r--r--1 keeling keeling 5973 Oct 7 2004 .emacs. You
have to chmod 600 .emacs.
Back to
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Pollywog said:
I have a function defined in my .bashrc as:
function lf { /bin/ls -l | grep ^- ; }
It prints the files in the CWD without listing other directories.
Suppose I want to 'chmod 600' all the files in the CWD without affecting
On Sunday 08 May 2005 05:08 pm, Phil Dyer wrote:
try this one.
function lsf {
for i in *; do
if [ -f $i ]; then
echo $i
fi;
done;
}
lsf | xargs chmod 600
Thanks, that works.
8)
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of
5 matches
Mail list logo