DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 25th March 2011
cq04cw cq04cw is offline
New User
 
Join Date: Sep 2010
Posts: 5
Thanked 0 Times in 0 Posts
Question declare same alias twice, alias values are different, why ?

Recently, i have learnd sh(1) manpages, and i have a doubt for an 'alias' command. there's an example below.



Code:
> sh
$ set -E
$ echo $-
imsE
$ alias
$ alias aa='cmd_a -a -b'
$ alias
aa='cmd_a -a -b'
this first time is ok
$ alias aa='cmd_a -a -b' $ alias aa='cmd_a -a -'
second time to declare the same alias to override the old one, but the option -b is gone, why is it?
$ uname -a FreeBSD foo.bar.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 $ ident /bin/sh /bin/sh: $FreeBSD: src/lib/csu/i386-elf/crti.S,v 1.7.22.1.6.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/lib/csu/i386-elf/crtn.S,v 1.6.22.1.6.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/lib/csu/i386-elf/crt1_s.S,v 1.1.2.3.2.2 2011/01/22 17:49:37 kib Exp $ $FreeBSD: src/lib/csu/common/crtbrand.c,v 1.6.2.1.6.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/alias.c,v 1.25.2.3.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/arith.y,v 1.22.2.3.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/arith_lex.l,v 1.24.10.2.4.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/cd.c,v 1.36.2.5.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/bltin/echo.c,v 1.14.30.1.6.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/error.c,v 1.26.10.3.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/eval.c,v 1.64.2.5.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/exec.c,v 1.34.2.5.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/expand.c,v 1.55.2.10.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/histedit.c,v 1.31.2.6.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/input.c,v 1.25.2.4.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/jobs.c,v 1.72.10.6.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/mail.c,v 1.14.10.3.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/main.c,v 1.31.2.6.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/memalloc.c,v 1.28.2.4.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/miscbltin.c,v 1.41.2.3.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/mystring.c,v 1.13.30.2.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/options.c,v 1.27.2.4.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/output.c,v 1.21.2.3.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/parser.c,v 1.63.2.10.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/redir.c,v 1.27.2.2.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/show.c,v 1.23.10.3.2.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/test/test.c,v 1.54.2.1.6.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/trap.c,v 1.34.2.1.6.1 2010/12/21 17:09:25 kensmith Exp $ $FreeBSD: src/bin/sh/var.c,v 1.39.2.6.2.1 2010/12/21 17:09:25 kensmith Exp $ $
Reply With Quote
 

Tags
alias, sh

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make delays between multiple commands in an alias (ircII) guitarscn Programming 3 23rd September 2010 12:36 AM
Changing MAC address to an alias interface? DNAeon FreeBSD General 6 20th January 2009 04:48 PM
pf tables how long values stored ijk FreeBSD Security 3 12th August 2008 11:45 AM
Mounting NAS as apache alias directory Yuka FreeBSD General 7 18th July 2008 02:58 PM
ip alias confusion hamba FreeBSD General 2 5th June 2008 10:23 AM


All times are GMT. The time now is 06:23 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick