I have a LINUX script problem.
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.
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
the script file follows:
#!/bin/bash
# /usr/local/bin/o
# by Ron KA4INM Youvan
if
/usr/bin/nice -n -20 chown -Rhc ka4inm:users $1$2$3$4
then
chmod 644 $1$2$3$4
sndcw 'e'
else
snd error
fi
# END /usr/local/bin/o
What am I missing?
("sndcw 'e'" goes beep in stereo speakers
and "snd error" goes "oohooh" in stereo speakers)
For every "oohooh" that I hear I must manually
fond a file to change manually.
When testing be careful, this will go into every
directory within it's path and change everything.
I've broken my system more than once with these.
-- 73 (= Best Regards) de: Ron ka4inm@tampabay.rr.com 100% LINUX, since July, 1997 SENT Time and Date are UTC Visit my HAM Web SITE at: http://www.qsl.net/ka4inm NO anti-virus crap used here ever!----------------------------------------------------------------------- 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:36:16 EDT