Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'please see this...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
please see this...
Authored by: jimr on Oct 16, '01 01:48:49AM
if you look in the directory

/usr/share/init/tcsh
you will see

README
aliases
completions
environment
login
logout
rc
tcsh.defaults

if you read the contents of
/etc/csh.cshrc
/etc/csh.login
/etc/csh.logout

there is a line similar to this...
source /usr/share/init/tcsh/rc

starting to look familiar?

then if you actually bother to read the README

you can find that each users account may be customized by

cd ~
cd Library/
mkdir init
cd init/
mkdir tcsh
cd tcsh
(you could just use the -p with mkdir -p init/tcsh)
then
pico environment.mine
Add additional environment variables
like custom colors for color ls

pico aliases.mine
make your aliases here...
pico login.mine
adjust your login environment
pico path
set up any custom paths which you might need

if you are the only user... sure edit the global files.

using this method... you will find you can keep users
environments and characteristics separate.
or alternatively as an administrator give
all of your users a common starting point.







[ Reply to This | # ]
re: please see this...
Authored by: sssss on Oct 16, '01 07:17:36PM

ooh! a README! cool, we need more of those.
thanks for pointing that out.
setting a user's aliases, etc, doesn't work for sudo though, huh?
do you know how to do that?



[ Reply to This | # ]
re: please see this...
Authored by: jimr on Oct 17, '01 06:41:59AM

yeah,
aliases are part of the shell

so if you

[devlin:~] jim% sudo ll
Password:
sudo: ll: command not found

where ll is one of the default aliases


on the other hand,

if you perform some trivial operation like ls
then ask for an alias

it seems to work

sudo ls; ll

in this case, the ll is performed as superuser

also check
sudo ls; alias
sudo ls; env

to prove this to myelf, I made a file as root

-rw-r--r-- 1 root wheel 5 Oct 17 19:22 remove_file

then
sudo ls; rm remove_file

gone

alternatively
I have a shell alias which sets edit to "pico"

so if I
sudo edit <filename>

Password:
sudo: edit: command not found

however;

sudo ls; edit test_file


the file is still made/owned by me
-rw-r--r-- 1 jim wheel 16 Oct 17 19:31 test_file

but for rm it works

so ....

seems better just to su

and get your self logged as root.

copy your aliases over to the root folder

check this out

sudo -s

then type "env"

Trying to decide what that is...
probably related to the security thing

best to type sudo -k if you go away from your keyboard.






[ Reply to This | # ]