Doesn't really work in this case Petre. We've got a few thousand
accounts in there and it takes a long time to parse.
We did get it solved today.
We ran it this way:
eval up=~$2 (took second arg from command line as the username).
Thanks to all for the help.
- Jamie
On 3 Jan 2002, Petre Scheie wrote:
> How about this:
>
> cp filename `grep $1 /etc/passwd |cut -d: -f6`
>
> On Wed, 2002-01-02 at 20:34, Jamie Ostrowski wrote:
> >
> >
> >
> >
> > I am trying to write a shell script that takes the first argument
> > from the command line as the user to whom a file is placed in their home
> > directory. I can't seem to get this to run. Normally, it wouldn't be a big
> > deal, you'd just do
> >
> > cp filename /home/$1
> >
> > but what throws a monkey wrench into the works is that there are
> > several different home partitions some users are in home, others in
> > home1,home2,home3, etc. and the following doesn't work:
> >
> > cp filename ~${1}/
> >
> > because it interprets the ~ as a character rather than an operator.
> >
> > Anyone have any ideas how I can get around this? Everytime I try to
> > run? Seems you can't combine the ~ with a variable.
> >
> >
> >
> > --
> >
> > "It's pretty hard to stop a man who eats his toast every morning."
> >
> >
> >
> >
> > _______________________________________________
> > Twin Cities Linux Users Group Mailing List - Minneapolis/St. Paul, Minnesota
> > http://www.mn-linux.org
> > tclug-list at mn-linux.org
> > https://mailman.mn-linux.org/mailman/listinfo/tclug-list
>
>
> _______________________________________________
> Twin Cities Linux Users Group Mailing List - Minneapolis/St. Paul, Minnesota
> http://www.mn-linux.org
> tclug-list at mn-linux.org
> https://mailman.mn-linux.org/mailman/listinfo/tclug-list
>
--
"It's pretty hard to stop a man who eats his toast every morning."