Re: [OT] Using aliases or functions in bash script

2008-02-01 Thread Michelle Konzack
Am 2008-01-26 16:48:18, schrieb T o n g: > Here is the full OP -- let me try for the last time: ??? > An advanced bash alias expansion question -- > How can I use my aliases or functions in my bash script? > > I have the following alias and function defined in my ~/.bashrc: > > $ alias rd >

Re: [OT] Using aliases or functions in bash script

2008-02-01 Thread Michelle Konzack
Am 2008-01-26 17:19:04, schrieb Daniel Dickinson: > and other-script.sh has > > #!/bin/bash > > source ~/.bashrc this is not needed, since the script is non-interactive and source ~/.bashrc automaticaly Thanks, Greetings and nice Day Michelle Konzack -- Linux-User #280138 with the Linux

Re: Using aliases or functions in bash script

2008-01-30 Thread Dan H.
On Tue, Jan 29, 2008 at 05:48:00PM +0100, Александър Л. Димитров wrote: > to be able to handle your daily work quicker. Aliases shouldn't be used in > shellscripts because: > > a) it makes them more difficult to understand (aliases often have very > unintuitive names) for other people Well, that

Re: [OT] Using aliases or functions in bash script

2008-01-29 Thread Александър Л . Димитров
Quoth William Pursell: > Another solution is to put the function and alias definitions > before the check for the interactive shell. I think that > a better solution is to define PS1 to fool the test as above, > but I don't think that is a particularly good solution either. > Probably better would

Re: Using aliases or functions in bash script

2008-01-29 Thread Александър Л . Димитров
Quoth T o n g: > On Sat, 26 Jan 2008 17:12:56 +, Tzafrir Cohen wrote: > > >> I'm wondering if you have read my OP or not. Read it again pls. > > > > Yes I have. Use functions. Don't use aliases. > > Despite its limitations, why one can't use aliases in scripts? > This sounds like "Don't use

Re: [OT] Using aliases or functions in bash script

2008-01-27 Thread michael
On 27 Jan 2008, at 14:08, T o n g wrote: On Sat, 26 Jan 2008 23:40:02 +, William Pursell wrote: An advanced bash alias expansion question -- How can I use my aliases or functions in my bash script? PS. I even tried the following but it didn't work either: $ bash -O expand_aliases -c

Re: [OT] Using aliases or functions in bash script

2008-01-27 Thread Andrew Sackville-West
On Sun, Jan 27, 2008 at 02:23:10PM +, T o n g wrote: > On Sat, 26 Jan 2008 14:59:35 -0800, Andrew Sackville-West wrote: > > > Instead of complaining pointlessly, maybe you could have said > > something like: . . . > > Sorry about my attitude, I was very disappointed that I carefully wrote > t

Re: [OT] Using aliases or functions in bash script

2008-01-27 Thread Celejar
On Sun, 27 Jan 2008 14:23:10 + (UTC) T o n g <[EMAIL PROTECTED]> wrote: > On Sat, 26 Jan 2008 14:59:35 -0800, Andrew Sackville-West wrote: [snip] > > No. I don't want to go back into my archive of 20,000 d-u posts and > > find your OP and read it in close detail now that we are several > > l

Re: [OT] Using aliases or functions in bash script

2008-01-27 Thread T o n g
On Sat, 26 Jan 2008 14:59:35 -0800, Andrew Sackville-West wrote: > Instead of complaining pointlessly, maybe you could have said > something like: . . . Sorry about my attitude, I was very disappointed that I carefully wrote the OP but nobody *seems* to read it carefully. Thanks again to *anyon

Re: [OT] Using aliases or functions in bash script

2008-01-27 Thread T o n g
On Sat, 26 Jan 2008 23:40:02 +, William Pursell wrote: >> An advanced bash alias expansion question -- >> How can I use my aliases or functions in my bash script? > >> PS. I even tried the following but it didn't work either: >> >> $ bash -O expand_aliases -c '. ~/.bashrc; (rd /tmp/ttt; a

Re: [OT] Using aliases or functions in bash script

2008-01-26 Thread William Pursell
T o n g wrote: An advanced bash alias expansion question -- How can I use my aliases or functions in my bash script? PS. I even tried the following but it didn't work either: $ bash -O expand_aliases -c '. ~/.bashrc; (rd /tmp/ttt; alias rd; dt bin; type dt)' The point of my previous resp

Re: [OT] Using aliases or functions in bash script

2008-01-26 Thread William Pursell
T o n g wrote: On Wed, 23 Jan 2008 20:47:15 -0900, Ken Irving wrote: An advanced bash alias expansion question -- How can I use my aliases or functions in my bash script? PS. I even tried the following but it didn't work either: $ bash -O expand_aliases -c '. ~/.bashrc; (rd /tmp/ttt; alia

Re: [OT] Using aliases or functions in bash script

2008-01-26 Thread Andrew Sackville-West
sorry I wasted your time. You know those of us who voluntarily help out here are just that, volunteers. We do it because we like to help and because we enjoy problem solving. But, speaking for myself, I really only like to help those who help us help them. All you have done is post a question

Re: [OT] Using aliases or functions in bash script

2008-01-26 Thread Daniel Dickinson
On Sat, 26 Jan 2008 21:40:12 + (UTC) T o n g <[EMAIL PROTECTED]> wrote: > On Sat, 26 Jan 2008 13:32:57 -0800, Andrew Sackville-West wrote: > > >> >> I'm wondering if you have read my OP or not. Read it again pls. > >> > > >> > source ~/.bashrc > >> > >> Guess that I am having bad lucks

Re: Using aliases or functions in bash script

2008-01-26 Thread T o n g
On Sat, 26 Jan 2008 17:12:56 +, Tzafrir Cohen wrote: >> I'm wondering if you have read my OP or not. Read it again pls. > > Yes I have. Use functions. Don't use aliases. Despite its limitations, why one can't use aliases in scripts? This sounds like "Don't use #define in C" to me (again, des

Re: Using aliases or functions in bash script

2008-01-26 Thread T o n g
On Sat, 26 Jan 2008 12:44:42 -0500, Daniel Dickinson wrote: > ./test.sh > Line 2 errors out. I imagine the same thing happens with his attempt > to use his bashrc-defined functions in a script without defining them > again in the script. > > IIUC he wants to know how to use already defined funct

Re: [OT] Using aliases or functions in bash script

2008-01-26 Thread T o n g
On Sat, 26 Jan 2008 13:32:57 -0800, Andrew Sackville-West wrote: >> >> I'm wondering if you have read my OP or not. Read it again pls. >> > >> > source ~/.bashrc >> >> Guess that I am having bad lucks now, having two people replied without >> even reading my question, and the two replies are

Re: [OT] Using aliases or functions in bash script

2008-01-26 Thread Andrew Sackville-West
On Sat, Jan 26, 2008 at 04:48:18PM +, T o n g wrote: > On Wed, 23 Jan 2008 20:47:15 -0900, Ken Irving wrote: > > >> I'm wondering if you have read my OP or not. Read it again pls. > > > > source ~/.bashrc > > Guess that I am having bad lucks now, having two people replied without > even

Re: Using aliases or functions in bash script

2008-01-26 Thread Wayne Topa
T o n g([EMAIL PROTECTED]) is reported to have said: > Hi, > > A (adv) bash alias expansion question -- > How can I use my aliases or functions in my bash script? > > I have the following alias and function defined in my ~/.bashrc: > > $ alias rd > alias rd='rmdir' > > $ type dt > dt

Re: Using aliases or functions in bash script

2008-01-26 Thread Daniel Dickinson
On Sat, 26 Jan 2008 18:03:32 + Tzafrir Cohen <[EMAIL PROTECTED]> wrote: > On Sat, Jan 26, 2008 at 12:44:42PM -0500, Daniel Dickinson wrote: > > On Sat, 26 Jan 2008 17:12:56 + > > Tzafrir Cohen <[EMAIL PROTECTED]> wrote: > > > > > On Thu, Jan 24, 2008 at 03:55:51AM +, T o n g wrote: >

Re: Using aliases or functions in bash script

2008-01-26 Thread Tzafrir Cohen
On Sat, Jan 26, 2008 at 12:44:42PM -0500, Daniel Dickinson wrote: > On Sat, 26 Jan 2008 17:12:56 + > Tzafrir Cohen <[EMAIL PROTECTED]> wrote: > > > On Thu, Jan 24, 2008 at 03:55:51AM +, T o n g wrote: > > > > > I'm wondering if you have read my OP or not. Read it again pls. > > > > Yes I

Re: Using aliases or functions in bash script

2008-01-26 Thread Daniel Dickinson
On Sat, 26 Jan 2008 17:12:56 + Tzafrir Cohen <[EMAIL PROTECTED]> wrote: > On Thu, Jan 24, 2008 at 03:55:51AM +, T o n g wrote: > > > I'm wondering if you have read my OP or not. Read it again pls. > > Yes I have. Use functions. Don't use aliases. > On command-line: function dt () {

Re: Using aliases or functions in bash script

2008-01-26 Thread Tzafrir Cohen
On Thu, Jan 24, 2008 at 03:55:51AM +, T o n g wrote: > I'm wondering if you have read my OP or not. Read it again pls. Yes I have. Use functions. Don't use aliases. -- Tzafrir Cohen | [EMAIL PROTECTED] | VIM is http://tzafrir.org.il || a Mutt's [EMAIL PROTECTED]

[OT] Using aliases or functions in bash script

2008-01-26 Thread T o n g
On Wed, 23 Jan 2008 20:47:15 -0900, Ken Irving wrote: >> I'm wondering if you have read my OP or not. Read it again pls. > > source ~/.bashrc Guess that I am having bad lucks now, having two people replied without even reading my question, and the two replies are the only replies that I get.

Re: Using aliases or functions in bash script

2008-01-23 Thread Ken Irving
On Thu, Jan 24, 2008 at 03:55:51AM +, T o n g wrote: > On Wed, 23 Jan 2008 23:21:37 +, Tzafrir Cohen wrote: > > >> I have the following alias and function defined in my ~/.bashrc: > >> > >> $ alias rd > >> alias rd='rmdir' > >> > >> $ type dt > >> dt is a function > >> dt () >

Re: Using aliases or functions in bash script

2008-01-23 Thread T o n g
On Wed, 23 Jan 2008 23:21:37 +, Tzafrir Cohen wrote: >> I have the following alias and function defined in my ~/.bashrc: >> >> $ alias rd >> alias rd='rmdir' >> >> $ type dt >> dt is a function >> dt () >> { >> pushd +$1 >> } >> >> How can I use them in my script? . .

Re: Using aliases or functions in bash script

2008-01-23 Thread Tzafrir Cohen
On Wed, Jan 23, 2008 at 11:10:13PM +, T o n g wrote: > Hi, > > A (adv) bash alias expansion question -- > How can I use my aliases or functions in my bash script? > > I have the following alias and function defined in my ~/.bashrc: > > $ alias rd > alias rd='rmdir' > > $ type dt >

Using aliases or functions in bash script

2008-01-23 Thread T o n g
Hi, A (adv) bash alias expansion question -- How can I use my aliases or functions in my bash script? I have the following alias and function defined in my ~/.bashrc: $ alias rd alias rd='rmdir' $ type dt dt is a function dt () { pushd +$1 } How can I use them in my scr