I'm trying to put together a basic script, it works fine when I run it as
root, but, I'm having issues when I try to run as 'voytek'

$ ls -al /usr/local/bin/ccc
-rwxr-x--- 1 root voytek 1409 May  9 08:19 /usr/local/bin/ccc


/usr/local/bin/ccc: line 16: ccc.txt: Permission denied
mv: overwrite `ccc.old', overriding mode 0644?
rm: remove write-protected regular file `logout.html'?
rm: remove write-protected regular file `logout.html'?
logout.html: Permission denied


script fetches a html page, parses it several times, then emails some text
from it

when starting the script should I say 'cd /var/tmp' (to have temp files
in/var/tmp?)

should I prefix full path to intermediate files ( /var/tmp/body.txt?)

-------------------------------
wget .... http://dom.tld/main.htm
wget .... ccc.html

echo "dump to text, get rid of blanks "
links -dump ccc.html > ccc.txt

## get rid of blank lines
awk '/Page/, /References/  { print }' ccc.txt  > ccc.bod

## Better remove all leading and trailing whitespace from end of each line:
sed 's/^[ \t]*//;s/[ \t]*$//' ccc.bod > ccc.1

# delete lines matching pattern
sed '/INT/d' ccc.1 > ccc

mail -s "ccc list" voytek < ccc

mv ccc ccc.old
rm main.htm
rm logout.html
rm ccc.1
rm ccc.bod
rm ccc.html
rm logout.html
rm my-cookies

-------------------------------

-- 
Voytek


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to