Re: alias(rm as mv)

2003-10-06 Thread Jeff Kinz
On Mon, Oct 06, 2003 at 06:00:42PM -0300, Herculano de Lima Einloft Neto wrote:
> On Mon, 2003-10-06 at 16:43, Jeff Kinz wrote:
> > Quick solution:
> > here=`pwd`
> >  for i in $*; do
> >  absolutename="/${i}"
> 
>  I take it you mean
> 
> absolutename="${here}/${i}" ?

Yes, that was what I intended.  (Still looking for a DWIW IDE. :) )
> 
> This still has one problem: we have to treat deletions with absolute
> pathnames.. there should be a command or something: `fullname`.. :)
> 
> >  dn=`dirname $i`
> >  bn=`basename $i`
> >  name=$dn/$bn
> >  echo $absolutename >> ~/.trashdb;
> >  done
> >  mv -i $* ~/.Trash;
> > 
> > Best bet - append the file being "trashed" to an existing gzipped tar
> > archive. This way the full pathname can be saved with each file nad each
> > file can besaved mutiple times in the archive.  To save pain at a later
> > date you can prepend each pathname with a "date_and_timestamp" making
> > it easier to name each version of the same file uniquely and allow
> > each one to be manipulated individually.
> 
>   I wonder if it would be easy to pull this functionality out of
> nautilus to the command line, since it implements it reasonably well.
> Should be for anyone involved with it.

I dunno.  Seems like you allready have most of what you need.  just
exchange the "mv -i" with "tar -zAF" ~/.Trash.tgz" $asolutename
(appending/prepending the timestamp to the file name is left as an
exercise to the reader :-) )

-- 
Jeff Kinz, Open-PC, Emergent Research,  Hudson, MA.  [EMAIL PROTECTED]
copyright 2003.  Use is restricted. Any use is an 
acceptance of the offer at http://www.kinz.org/policy.html.
Don't forget to change your password often.


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list


Re: alias(rm as mv)

2003-10-06 Thread Herculano de Lima Einloft Neto
On Mon, 2003-10-06 at 16:43, Jeff Kinz wrote:
> Quick solution:
> here=`pwd`
>  for i in $*; do
>absolutename="/${i}"

 I take it you mean

absolutename="${here}/${i}" ?

This still has one problem: we have to treat deletions with absolute
pathnames.. there should be a command or something: `fullname`.. :)

>  dn=`dirname $i`
>  bn=`basename $i`
>  name=$dn/$bn
>  echo $absolutename >> ~/.trashdb;
>  done
>  mv -i $* ~/.Trash;
> 
> You still have the massive probleme of files that all posses the same 
> basename even though they came from different directories.

  Yeah.. it would be kind of boring to treat that. At least you'll know
with -i.

> Best bet - append the file being "trashed" to an existing gzipped tar
> archive. This way the full pathname can be saved with each file nad each
> file can besaved mutiple times in the archive.  To save pain at a later
> date you can prepend each pathname with a "date_and_timestamp" making
> it easier to name each version of the same file uniquely and allow
> each one to be manipulated individually.

  That sounds pretty good.. 

  I wonder if it would be easy to pull this functionality out of
nautilus to the command line, since it implements it reasonably well.
Should be for anyone involved with it.

Thanks
-- 
Herculano de Lima Einloft Neto <[EMAIL PROTECTED]>


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list


Re: alias(rm as mv)

2003-10-06 Thread Jeff Kinz
On Mon, Oct 06, 2003 at 04:22:36PM -0300, Herculano de Lima Einloft Neto wrote:
>   I'm not sure this is what you want, but you could use:
> 
> del() { mv -i $* ~/.Trash; }
> 
>   You can put it in ~/.bashrc
>   You should find a lot about this searching around.. you shouldn't use
> rm as the new command's name, to keep the respect for it.
> 
>   On this subject, if anyone can help:
> 
>   I'm trying to make it better, something like:
> 
> for i in $*; do
> dn=`dirname $i`
> bn=`basename $i`
> name=$dn/$bn
> echo $name >> ~/.trashdb;
> done
> mv -i $* ~/.Trash;
> 
> Except this doesn't work.. could anyone please tell me the way to get a
> file's absolute name from within a script?

Quick solution:
here=`pwd`
 for i in $*; do
 absolutename="/${i}"
 dn=`dirname $i`
 bn=`basename $i`
 name=$dn/$bn
 echo $absolutename >> ~/.trashdb;
 done
 mv -i $* ~/.Trash;

You still have the massive probleme of files that all posses the same 
basename even though they came from different directories.

Best bet - append the file being "trashed" to an existing gzipped tar
archive. This way the full pathname can be saved with each file nad each
file can besaved mutiple times in the archive.  To save pain at a later
date you can prepend each pathname with a "date_and_timestamp" making
it easier to name each version of the same file uniquely and allow
each one to be manipulated individually.

-- 
Jeff Kinz, Open-PC, Emergent Research,  Hudson, MA.  [EMAIL PROTECTED]
copyright 2003.  Use is restricted. Any use is an 
acceptance of the offer at http://www.kinz.org/policy.html.
Don't forget to change your password often.


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list


Re: alias(rm as mv)

2003-10-06 Thread Herculano de Lima Einloft Neto
Himanshu Arora wrote:
> Hi All!
> i want rm command to be converted into
> 
> mv (whatever is there after rm command) Trash/
> 
> where Trash/ is the final destination.
> But the alias command doesn't have any support for the above mentioned 
> purpose. Could you suggest me a way to convert rm into mv ?
> Himanshu Arora
> IIIT Hyderabad


  I'm not sure this is what you want, but you could use:

del() { mv -i $* ~/.Trash; }

  You can put it in ~/.bashrc
  You should find a lot about this searching around.. you shouldn't use
rm as the new command's name, to keep the respect for it.

  On this subject, if anyone can help:

  I'm trying to make it better, something like:

for i in $*; do
dn=`dirname $i`
bn=`basename $i`
name=$dn/$bn
echo $name >> ~/.trashdb;
done
mv -i $* ~/.Trash;

Except this doesn't work.. could anyone please tell me the way to get a
file's absolute name from within a script?

Thanks in advance,
-- 
Herculano de Lima Einloft Neto <[EMAIL PROTECTED]>


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list


Re: alias(rm as mv)

2003-10-06 Thread Ed Wilts
On Mon, Oct 06, 2003 at 11:44:34PM +0530, Himanshu Arora wrote:
> i want rm command to be converted into
> 
> mv (whatever is there after rm command) Trash/
> 
> where Trash/ is the final destination.
> But the alias command doesn't have any support for the above mentioned 
> purpose. Could you suggest me a way to convert rm into mv ?

You simply can't do this by aliasing and expect to always work. Rewrite
the rm command to do what you want.

-- 
Ed Wilts, Mounds View, MN, USA
mailto:[EMAIL PROTECTED]
Member #1, Red Hat Community Ambassador Program


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list


RE: alias

2003-02-05 Thread Larry Brown
I thank everyone for their help.  It sounds like the UID & GID method is the
most comprehensive and gives the exact result that I was looking for.

Thanks all..

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Tibbetts, Ric
Sent: Wednesday, February 05, 2003 8:13 AM
To: [EMAIL PROTECTED]
Subject: Re: alias

Go the easy route.
Just create a second user with the same UID & GID as Fred, and using
Freds home directory.

The /etc/passwd would look something like:

foo:x:500:500:Foo User:/home/foo:/bin/bash
bar:x:500:500:Fred User:/home/foo:/bin/bash

  Then set the password to be the same as foo

Then when bar logs in, he is "really" foo, and uses foo's environment,
and home dirs.

NOTE: useradd will probably complain about doing this, as will nearly
all user creation tools. You'll need to add the password entries by
hand, then run the passwd command to sync the shadow passwords.

AND: YES, this can be done for a root account. We used to use what we
called a "root2" account for customers that needed root. We'd create a
shadow account like the one above. Then the passwords can be different,
and we could pull access if they acted up.

A Caviat:
If user "bar", decides to change his password, he MUST type it as:

#> passwd bar

If he just enters
#> passwd

He'll change the password for foo. Since they have the same UID, passwd
will change the first one it comes accross in /etc/passwd, so he needs
to be specific.

Easy.

cheers!

Ric



Larry Brown wrote:
> Is it possible to create an alias for a user for login etc.  Example would
> be a user named fred in the Linux system.  I want to create an alias named
> coo for Fred.  So fred could log in as coo with the password Fred would
> normally use and log in.  He would look like the user coo but would have
all
> of the access rights and privileges of Fred.  Then as a follow-up, if it
is
> possible, is it possible to do this for root?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
>
>
>
>



--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list




-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: alias

2003-02-05 Thread Tibbetts, Ric
Go the easy route.
Just create a second user with the same UID & GID as Fred, and using 
Freds home directory.

The /etc/passwd would look something like:

foo:x:500:500:Foo User:/home/foo:/bin/bash
bar:x:500:500:Fred User:/home/foo:/bin/bash

 Then set the password to be the same as foo

Then when bar logs in, he is "really" foo, and uses foo's environment, 
and home dirs.

NOTE: useradd will probably complain about doing this, as will nearly 
all user creation tools. You'll need to add the password entries by 
hand, then run the passwd command to sync the shadow passwords.

AND: YES, this can be done for a root account. We used to use what we 
called a "root2" account for customers that needed root. We'd create a 
shadow account like the one above. Then the passwords can be different, 
and we could pull access if they acted up.

A Caviat:
If user "bar", decides to change his password, he MUST type it as:

   #> passwd bar

If he just enters
   #> passwd

He'll change the password for foo. Since they have the same UID, passwd 
will change the first one it comes accross in /etc/passwd, so he needs 
to be specific.

Easy.

cheers!

	Ric



Larry Brown wrote:
Is it possible to create an alias for a user for login etc.  Example would
be a user named fred in the Linux system.  I want to create an alias named
coo for Fred.  So fred could log in as coo with the password Fred would
normally use and log in.  He would look like the user coo but would have all
of the access rights and privileges of Fred.  Then as a follow-up, if it is
possible, is it possible to do this for root?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388









--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



RE: alias

2003-02-03 Thread Joshua Schmidlkofer
Ahhh..  Always important to include details.  Many ways to handle this,
first of all, you can override unix permissions with a samba share, and
only set the valid users list to any arbitrary samba user.  You can also
use the username map. You can also add another user with a UID and GID
of '0', and that will work as well.  

samba example:

[etc]
browseable = no
writeable = yes
delete readonly = yes
path = /etc
only user = yes
force group = root
force user = root
create mode = 644
user = jms


note:  this will force user & group permission on changed files to be
root.  That is not necessarily desirable.  However, for simple cases,
this would be fine and more detailed administration should happen via
Putty, or SSH or whatever.


js


On Mon, 2003-02-03 at 20:11, Larry Brown wrote:
> What prompted this line of questioning was the idea that in a closed and
> safe environment one could use this method to set up an alias for root as
> say...administrator.  Then one 9x machine could log on as administrator and
> access all of the win2k/nt/Linux boxes through samba with full authority to
> make any changes.  Even if there is a way to make an alias, I don't know if
> it would then work via samba as a real user.  This was just an idea I wanted
> to explore.  The uid and gid idea expressed earlier could apply here, I've
> never tried it.
> 
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
> -- 
> VB programmers ask why no one takes them seriously, 
> it's somewhat akin to a McDonalds manager asking employees 
> why they don't take their 'career' seriously.



signature.asc
Description: This is a digitally signed message part


RE: alias

2003-02-03 Thread Bret Hughes
On Mon, 2003-02-03 at 22:11, Larry Brown wrote:
> What prompted this line of questioning was the idea that in a closed and
> safe environment one could use this method to set up an alias for root as
> say...administrator.  Then one 9x machine could log on as administrator and
> access all of the win2k/nt/Linux boxes through samba with full authority to
> make any changes.  Even if there is a way to make an alias, I don't know if
> it would then work via samba as a real user.  This was just an idea I wanted
> to explore.  The uid and gid idea expressed earlier could apply here, I've
> never tried it.
> 

Hmm. I like that idea.  I am working on a project where we are
integrating the first samba server into a small NT network.  As it is my
first experience with a windows NT domain environment and the sysadmin
(my brother) is not very linux savvy yet we were discussing today the
best way for him to view the logs from windows, as he can for the three
NT servers without having to log onto the box and going to the other
tool.  

One of the things we discussed but have not tested is sharing /var/log
and only granting access to the admin group. At least he can explore the
dir and click on the logs to read them. Let me know what you come up
with.

Bret



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



RE: alias

2003-02-03 Thread Larry Brown
What prompted this line of questioning was the idea that in a closed and
safe environment one could use this method to set up an alias for root as
say...administrator.  Then one 9x machine could log on as administrator and
access all of the win2k/nt/Linux boxes through samba with full authority to
make any changes.  Even if there is a way to make an alias, I don't know if
it would then work via samba as a real user.  This was just an idea I wanted
to explore.  The uid and gid idea expressed earlier could apply here, I've
never tried it.

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Bret Hughes
Sent: Monday, February 03, 2003 10:35 PM
To: [EMAIL PROTECTED]
Subject: Re: alias

On Mon, 2003-02-03 at 19:04, Ze Ji Li wrote:
> How about just give him the same uid and gid?  will that work?
>

I fred just need to rights to do anything as coo take a look at sudo
this is exactly what it was designed for.  Extremely configurable with
fine grained control or open it up.  What ever you want.  I use it all
the time for quick edits of system files
eg

sudo vi /etc/hosts

opens up vi with root privs

Bret



--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list




-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: alias

2003-02-03 Thread Bret Hughes
On Mon, 2003-02-03 at 19:04, Ze Ji Li wrote:
> How about just give him the same uid and gid?  will that work?
> 

I fred just need to rights to do anything as coo take a look at sudo
this is exactly what it was designed for.  Extremely configurable with
fine grained control or open it up.  What ever you want.  I use it all
the time for quick edits of system files
eg

sudo vi /etc/hosts

opens up vi with root privs 

Bret  



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: alias

2003-02-03 Thread Ze Ji Li
How about just give him the same uid and gid?  will that work?

Ze

- Original Message -
From: "Larry Brown" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 03, 2003 2:20 PM
Subject: RE: alias


> Problem with just having him in the same group is that group and owner
> privileges are rarely identical so unless steps where always made to make
> them identical this would not have the same result as an alias.  So I take
> it that there is no such animal as a user alias (other than for mail
> purposes)?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Robert Canary
> Sent: Monday, February 03, 2003 6:57 PM
> To: [EMAIL PROTECTED]
> Subject: Re: alias
>
> You would create a second user named coo with the same password as fred,
> and assign coo to the fred group.
>
> Larry Brown wrote:
> >
> > Is it possible to create an alias for a user for login etc.  Example
would
> > be a user named fred in the Linux system.  I want to create an alias
named
> > coo for Fred.  So fred could log in as coo with the password Fred would
> > normally use and log in.  He would look like the user coo but would have
> all
> > of the access rights and privileges of Fred.  Then as a follow-up, if it
> is
> > possible, is it possible to do this for root?
> >
> > Larry S. Brown
> > Dimension Networks, Inc.
> > (727) 723-8388
> >
> > --
> > redhat-list mailing list
> > unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> > https://listman.redhat.com/mailman/listinfo/redhat-list
>
>
>
> --
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list
>
>
>
>
> --
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list
>



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



RE: alias

2003-02-03 Thread Larry Brown
Problem with just having him in the same group is that group and owner
privileges are rarely identical so unless steps where always made to make
them identical this would not have the same result as an alias.  So I take
it that there is no such animal as a user alias (other than for mail
purposes)?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Robert Canary
Sent: Monday, February 03, 2003 6:57 PM
To: [EMAIL PROTECTED]
Subject: Re: alias

You would create a second user named coo with the same password as fred,
and assign coo to the fred group.

Larry Brown wrote:
>
> Is it possible to create an alias for a user for login etc.  Example would
> be a user named fred in the Linux system.  I want to create an alias named
> coo for Fred.  So fred could log in as coo with the password Fred would
> normally use and log in.  He would look like the user coo but would have
all
> of the access rights and privileges of Fred.  Then as a follow-up, if it
is
> possible, is it possible to do this for root?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
> --
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list



--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list




-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: alias

2003-02-03 Thread Robert Canary
You would create a second user named coo with the same password as fred,
and assign coo to the fred group.

Larry Brown wrote:
> 
> Is it possible to create an alias for a user for login etc.  Example would
> be a user named fred in the Linux system.  I want to create an alias named
> coo for Fred.  So fred could log in as coo with the password Fred would
> normally use and log in.  He would look like the user coo but would have all
> of the access rights and privileges of Fred.  Then as a follow-up, if it is
> possible, is it possible to do this for root?
> 
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
> 
> --
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: Alias Substitution

2000-06-20 Thread Todd A. Jacobs

On Mon, 19 Jun 2000, SoloCDM wrote:

> > > Is it possible to make an alias substitute an item into its command as
> > > in the following:

No.

-- 
Todd A. Jacobs
Senior Network Consultant



-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.




Re: Alias Substitution

2000-06-20 Thread Steven W. Orr

This question has already been properly answered by explaining the use of
functions in bash which are used to replace csh style parameterized
aliases. But the particular question begs for one more comment:

You can say

CDPATH='.:~'

in your .bashrc, or you can just say

export CDPATH='.:~'

in your .bash_profile

-- 
-Time flies like the wind. Fruit flies like a banana. [EMAIL PROTECTED]
-Stranger things have happened but none stranger than this. Steven W. Orr-
Does your driver's license say Organ Donor?Black holes are where God \
---divided by zero. Listen to me! We are all individuals!-

On Mon, 19 Jun 2000, SoloCDM wrote:

=>"Carey F. Cox" wrote:
=>> 
=>> On Mon, 19 Jun 2000, SoloCDM wrote:
=>> 
=>> > Is it possible to make an alias substitute an item into its command as
=>> > in the following:
=>> >
=>> >   $ alias cdl='cd ~/$@'
=>> >   $ cdl nsmail/Administrator.sbd
=>> 
=>> For bash scripts you will need to use a function as follows...
=>> 
=>> $ function cdl { cd ~/$@ }
=>
=>Thanks, but I'm referring to the command-line -- not a script.


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.




Re: Alias Substitution

2000-06-20 Thread Carey F. Cox

On Mon, 19 Jun 2000, SoloCDM wrote:

> "Carey F. Cox" wrote:
> > 
> > For bash scripts you will need to use a function as follows...
> > 
> > $ function cdl { cd ~/$@ }
> 
> Thanks, but I'm referring to the command-line -- not a script.
> 

A script is no more than a bunch of command line "commands" put 
together. Stick the above in your ~/.bashrc and it will work. 
I have tried it already. Alternatively, you can type it on the 
"command line" everytime you login, but that would be tedious, so 
stick it in your startup "script," ~/.bashrc.

Hope that clarifies things.

Carey

-- 
 ==
<>   Carey F. Cox, PhD |  PHONE: (409) 880-8770   <>
<>   Assistant Professor   |  FAX:   (409) 880-8121   <>
<>   Dept. of Mech. Eng.   |  EMAIL: [EMAIL PROTECTED]  <>
<>   Lamar University  |  WEB:   N/A  <>
 ==


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.




Re: Alias Substitution

2000-06-19 Thread SoloCDM

"Carey F. Cox" wrote:
> 
> On Mon, 19 Jun 2000, SoloCDM wrote:
> 
> > Is it possible to make an alias substitute an item into its command as
> > in the following:
> >
> >   $ alias cdl='cd ~/$@'
> >   $ cdl nsmail/Administrator.sbd
> 
> For bash scripts you will need to use a function as follows...
> 
> $ function cdl { cd ~/$@ }

Thanks, but I'm referring to the command-line -- not a script.

Note: Detailed Document(s) and Sample(s) are more than welcome.
  When you reply to this message, please include
  the mailing list and my address.

*
Signed,
SoloCDM


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.




Re: Alias Substitution

2000-06-19 Thread Carey F. Cox

On Mon, 19 Jun 2000, SoloCDM wrote:

> Is it possible to make an alias substitute an item into its command as
> in the following:
> 
>   $ alias cdl='cd ~/$@'
>   $ cdl nsmail/Administrator.sbd

For bash scripts you will need to use a function as follows...

$ function cdl { cd ~/$@ }

-- 
 ==
<>   Carey F. Cox, PhD |  PHONE: (409) 880-8770   <>
<>   Assistant Professor   |  FAX:   (409) 880-8121   <>
<>   Dept. of Mech. Eng.   |  EMAIL: [EMAIL PROTECTED]  <>
<>   Lamar University  |  WEB:   N/A  <>
 ==


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.




Re: alias color in ls

1998-03-24 Thread Brandt Kurowski

Craig Kattner wrote:
> H. Well, I had alias dir="ls -F --color=yes" in my /etc/bashrc and
> for example piping things to less printed the color codes but not to
> more. So, I just tried it out with --color and with --color=tty and
> got the same results. Probably more a less issue then a ls thing, but
> it is identical behavior regardless.

I think it worked with more because more simply prints whatever it gets
(cat binary_file | more == bad). less tries to be smarter, but this
means no pretty color codes. I used to have an alias with 'color=yes'
(no wonder my 'ls' pipes never seemed to work right). I just switched to
'color=tty' and it works much better now. Be sure you didn't miss a
detail when you tried with color=tty, cause it's much nicer.

Regards,
 Brandt


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



Re: alias color in ls

1998-03-24 Thread Craig Kattner

> > > >edit .bashrc in your home directory and add
> > > >
> > > >alias ls='ls --color=yes'
> > > 
> > > Better to use "--color=tty".
> > 
> > "--color" works equally good.
> 
> No, it doesn't always.
> 
> For instance:
> 
> % /bin/ls -a --color > foo
> % cat -v foo
> ^[[01;34m.^[[0m
> ^[[01;34m..^[[0m
> ^[[0mfoo^[[0m
> 
> With --color, any programs which take the ouput of ls through, say, a 
> pipe will be confused by the escape codes. The --color=tty option will 
> only output escape sequences (and colors) to the screen.

H. Well, I had alias dir="ls -F --color=yes" in my /etc/bashrc and for
example piping things to less printed the color codes but not to more. So,
I just tried it out with --color and with --color=tty and got the same
results. Probably more a less issue then a ls thing, but it is identical
behavior regardless.


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



Re: alias color in ls

1998-03-24 Thread Kent R. Frazier

I added the following line to my .bashrc file under #User specific aliases and 
functions

alias ls='ls --color al'

This gives me both color and a detailed listing, which being a newbie really helps :)

I have version 4.2

Joey Officer wrote:

> I've tried adding the alias command to my .bashrc ... but it still no
> worky...
>
> Do I have to have a new version of redhat possibly?
>
> I dunno
>
> joey
>
> --
>   PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
> http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
>  To unsubscribe: mail [EMAIL PROTECTED] with
>"unsubscribe" as the Subject.




-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



Re: alias color in ls

1998-03-24 Thread Stelios Bounanos

Henrik Edlund <[EMAIL PROTECTED]> wrote:

> On Tue, 24 Mar 1998, Steve "Stevers!" Coile wrote:
> 
> > On Mon, 23 Mar 1998, Dan Cyr wrote:
> > >edit .bashrc in your home directory and add
> > >
> > >alias ls='ls --color=yes'
> > 
> > Better to use "--color=tty".
> 
> "--color" works equally good.

No, it doesn't always.

For instance:

% /bin/ls -a --color > foo
% cat -v foo
^[[01;34m.^[[0m
^[[01;34m..^[[0m
^[[0mfoo^[[0m

With --color, any programs which take the ouput of ls through, say, a 
pipe will be confused by the escape codes. The --color=tty option will 
only output escape sequences (and colors) to the screen.


sb

-- 
 "Men of lofty genius are most active
when they are doing the least work".
   -- Leonardo da Vinci



-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



RE: alias color in ls

1998-03-24 Thread Tempel, Philippe

> I've tried adding the alias command to my .bashrc ... but it still no
> worky...
> 
[PT]  Did you use the correct syntax?  For example,
I use the following to alias "dir" to "ls -al":

alias dir="ls -al"

Also, you can try putting the alias at the end of
your .bash_profile file.

> Do I have to have a new version of redhat possibly?
> 
[PT]  No.  This is purely a bash issue.  It should also
work with many different versions of bash as well.


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



Re: alias color in ls

1998-03-24 Thread Joey Officer

I've tried adding the alias command to my .bashrc ... but it still no
worky...

Do I have to have a new version of redhat possibly?

I dunno

joey


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



Re: alias color in ls

1998-03-24 Thread Dan Cyr


edit .bashrc in your home directory and add

alias ls='ls --color=yes'

or to make it global for all users add it to /etc/bashrc


Dan

At 05:27 PM 3/23/98 -0600, Joey Officer wrote:
>I tried to setup color to be added when I do an 
>
>ls -l -color
>
>but it says 
>ls: unrecognized option `--color'
>
>how do I setup the ls so that I can add color?
>
>Joey
>
>Linux 3.0.3 Picasso
>
>
>-- 
>  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
>http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
> To unsubscribe: mail [EMAIL PROTECTED] with 
>   "unsubscribe" as the Subject.
>


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



RE: alias color in ls

1998-03-24 Thread Peter J Spalding

Try this too:
Alias ls='ls -color=tty'
You do that on the command line each time you start a shell, or, put it in the 
.bashrc file.
-Original Message-
From:   Dan Cyr [SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, March 24, 1998 12:04 AM
To: [EMAIL PROTECTED]; RedHat TechLine
Subject:    Re: alias color in ls


edit .bashrc in your home directory and add

alias ls='ls --color=yes'

or to make it global for all users add it to /etc/bashrc


Dan

At 05:27 PM 3/23/98 -0600, Joey Officer wrote:
>I tried to setup color to be added when I do an 
>
>ls -l -color
>
>but it says 
>ls: unrecognized option `--color'
>
>how do I setup the ls so that I can add color?
>
>Joey
>
>Linux 3.0.3 Picasso
>
>
>-- 
>  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
>http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
> To unsubscribe: mail [EMAIL PROTECTED] with 
>   "unsubscribe" as the Subject.
>


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



Re: alias color in ls

1998-03-24 Thread Henrik Edlund

On Tue, 24 Mar 1998, Steve "Stevers!" Coile wrote:

> On Mon, 23 Mar 1998, Dan Cyr wrote:
> >edit .bashrc in your home directory and add
> >
> >alias ls='ls --color=yes'
> 
> Better to use "--color=tty".

"--color" works equally good.

-- 
Henrik Edlund <[EMAIL PROTECTED]>
PGP Public Key available at http://www.piett.com/about/pgp.txt

  "They were in the wrong place at the wrong time.
Naturally they became heroes."
  Leia Organa of Alderaan, Senator


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



Re: alias color in ls

1998-03-24 Thread Steve \"Stevers!\" Coile

On Mon, 23 Mar 1998, Dan Cyr wrote:
>edit .bashrc in your home directory and add
>
>alias ls='ls --color=yes'

Better to use "--color=tty".

-- 
Steve Coile
 [EMAIL PROTECTED]


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.



Re: alias color in ls

1998-03-23 Thread Blair Craft

ls --color=tty

On Mon, 23 Mar 1998, Joey Officer wrote:

> I tried to setup color to be added when I do an 
> 
> ls -l -color
> 
> but it says 
> ls: unrecognized option `--color'
> 
> how do I setup the ls so that I can add color?
> 
> Joey
> 
> Linux 3.0.3 Picasso
> 
> 
> -- 
>   PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
> http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
>  To unsubscribe: mail [EMAIL PROTECTED] with 
>"unsubscribe" as the Subject.
> 

--- end message ---
__________  __ 
 __/ Blair Craft   __/  \  /  \  /  \  /  \____/  \
/  \ [EMAIL PROTECTED]   \__/  \__/  \__/  \  /  \__/
\__/ http://mindlink.net/bsc/main.html\__/  \__/  \
   \__/\__/  \__/  \__/


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
 To unsubscribe: mail [EMAIL PROTECTED] with 
   "unsubscribe" as the Subject.