[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Unnecessary rebooting (was Re: Bash argument expanded inside alias)



> From: Chris Bannister <cbannister@slingshot.co.nz>, Date: Wed, 14 Mar 2012 18:00:24 +1300
>
> [Please, don't top post in this mailing list]
>
> Just logout then log back in again, or even better, type:
> "source .bashrc" at a command prompt. :)
> --
> "Religion is excellent stuff for keeping common people quiet."
>   -- Napoleon Bonaparte


Dear Chris,

Thanks for this great tip "source". I must admit I google for
something like that, but I was trying to find in "man bash" some
argument to let bash or sh to run in the same environment. I think its
an old trick, and 'source' is newer, but I'm not sure and I didn't
find anything.



Dear Camaleón,

Unfortunately, this nice command of yours doesn't seem to work. Is it
me typing something wrong, or there is really a problem?
:~$ alias muda='find $1 -name "*" -mtime $2'
:~$ muda /home/cheetara -4
find: invalid arg `-4' for `-mtime'

Funny is that no matter if I change $2 to $1, the error is the same. Look:
:~$ alias muda='find $2 -name "*" -mtime $1'
:~$ muda /home/aluno -4
find: invalid arg `-4' for `-mtime'

Even worse, I tell it to use $1, but give two args in the command line, and get:
:~$ alias muda='find . -name "*" -mtime $1'
:~$ muda /home/cruelbash -4
find: invalid arg `-4' for `-mtime'


That is just to chitchat, as for now the function solution works great!

Thanks,
Beco.

PS. Sorry for an earlier "top post", and an warning of "non html".
It'll not happen again.
PPS. I think I need to change the list subscription from digest to
normal emails. I tried subject:help to debian-user-request, but the
message that came back was of no help. (Maybe this is offtopic here --
in this email of course, and in the list in general)? A quick
indication will do.


Reply to: