simple bash alias driving me crazy

simple bash alias driving me crazy

Post by Ralph Bran » Tue, 04 Feb 1997 04:00:00

   After 5 hrs of experiments and man pages etc I hope someone can tell me
how to solve this seemingly simple problem:

   If I have the following line in my ".bashrc" file:

         alias hcum="hcopy /home/brands/$1 'C:Doc:unix_to_mac:$2'"

   and I then enter at the bash prompt:

         hcum firstfilename secondfilename

   is this not equivalent to entering at the bash prompt:

         hcopy /home/brands/firstfilename 'C:Doc:unix_to_mac:secondfilename'

This last line when entered at the bash prompt does what I want to do.
The alias does not work, even though analagous aliases with other
functions like "cp" work.  My MkLinux tells me:

         hcopy: hcopy "firstfilename" not a directory

Well it isn't a directory and bash is perfectly happy to not insist it's a
directory wgeb U type the full command at the bash prompt.  FYI, in
MkLinux "hcopy" copies files from the Linux filesystem to Mac filesystem.

Many thanks,

Ralph Brands
University of British Columbia


simple bash alias driving me crazy

Post by B.A.McCau.. » Wed, 05 Feb 1997 04:00:00

Quote:>   If I have the following line in my ".bashrc" file:

>         alias hcum="hcopy /home/brands/$1 'C:Doc:unix_to_mac:$2'"

Bash alaises don't take arguments.  Bash funtions do.

Did you ever consider doing "man bash"?  (RTFM)

BTW I think you've got the quoting on the second argument wrong
anyhow, $2 will not be substitued inside single quotes.

hcum() { hcopy /home/brands/$1 "C:Doc:unix_to_mac:$2" ; }

[ Bash 1.x users: note the semicolon, you'll need it when you upgrade
to Bash 2.0 ]


 .  _\\__[oo       from       | Phones: +44 121 471 3789 (home)

.  l___\\    /~~) /~~[  /   [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
 # ll  l\\  ~~~~ ~   ~ ~    ~ |



Is there a proper fixed bash on any of the FTP sites out there?

I know there bash is on the usual sites but I don't know if they are
bugged or not :(




------------------------------------| Edinburgh, EH14 2DE, United Kingdom
**Domino: There`s nothing you can do when you`re the next in line: Domino**

2. sound on a ppc 6400/200

3. simple expect script drives me crazy

4. [patch[ Simple Topology API

5. Simple problem, but driving me crazy

6. Any ftp site for SPARC Solaris binaries?

7. HELP!!! Backspace driving me crazy in bash

8. gettimeofday function

9. Simple network driving me crazy?! (quite long)

10. simple bash alias expansion question

11. simple question: bash aliases and functions in X

12. dvd drive driving me crazy