[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] site directory names
- Subject: Re: [cobalt-users] site directory names
- From: "Steve Werby" <steve-lists@xxxxxxxxxxxx>
- Date: Tue Jul 9 14:36:01 2002
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
"Brian Quinn" <brian@xxxxxxxxx> wrote:
> yeah i see the links when i do the ls -la like i said, i just hate that
the
> directorys are names SITE1, SITE2, etc
> cause when i'm in one and do a PWD it's showing SITE1, etc and not the
> domain i'm trying to modify
Hi Brian. If you enter a directory via /home/sites/host.domain.tld, does
'pwd' return a path including "siteN" or "host.domain.tld"? In my
experience, what pwd returns depends on how you enter the directory.
Instead of modifying lots of Cobalt scripts to make your life easier, try a
script like this one I whipped up.
#!/bin/sh
ls -al /home/sites | grep /home/sites/site$1$ | awk '{print $9}'
Save it as something like /usr/local/bin/magic, chmod 700, 755 or whatever
suits you and then you can call it like this:
magic 5
# Above will return the host.domain.tld for site5.
You could modify the script so that it doesn't require a parameter to be
passed. Just use a regular expression to pull the siteN from pwd within
backticks. But if you're going to do that, you might also want to add a
.bashrc file to your user directory and set PS1 to contain the sitename and
export it so your bash prompt shows the sitename. Google for
details/instructions. If you try any of this and run into obstacles, post
on list, one of us, maybe me, should be able to help, time permitting.
HTH,
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/