Date: Sun, 21 Jun 1998 16:20:02 -0700 (PDT) From: "Kevin G. Eliuk" <kevin_eliuk@sunshine.net> To: Tim Gerchmez <fewtch@serv.net> Cc: Dru <genisis@istar.ca>, freebsd-newbies@FreeBSD.ORG Subject: Re: Latest discoveries... Message-ID: <Pine.BSF.3.96.980621160834.3498A-100000@vanessa.eliuk.org> In-Reply-To: <3.0.5.32.19980621144626.007f7e80@mx.serv.net>
next in thread | previous in thread | raw e-mail | index | archive | help
HELO Tim,
After reading `man 1 csh', i tried this:
---
vanessa# alias test "touch A ; cp A A2 ; ls -l A*"
vanessa# test
-rw-r--r-- 1 root wheel 0 Jun 21 16:06 A
-rw-r--r-- 1 root wheel 0 Jun 21 16:06 A2
vanessa# unalias test
vanessa# test
vanessa# which test
/bin/test
vanessa# file /bin/test
/bin/test: FreeBSD/i386 compact demand paged executable
vanessa# alias A "touch A ; cp A A2 ; ls -l A*"
vanessa# rm A
vanessa# rm A2
vanessa# A
-rw-r--r-- 1 root wheel 0 Jun 21 16:13 A
-rw-r--r-- 1 root wheel 0 Jun 21 16:13 A2
---
Not have ever asked the question before I assumed creatin a shell script
the best course and keeping any of those in $HOME/bin.
On Sun, 21 Jun 1998, Tim Gerchmez wrote:
=>
=> Well, I do want to know if it CAN be done as a simple alias rather than
=> using a shell script. I certainly wouldn't mind learning to write shell
=> scripts, but I'd also like to know if an alias in .cshrc can include more
=> than one command, and if so, what the correct syntax would be.
=>
=> Thanks for the suggestion,
=>
=> Tim
=>
=> At 05:06 PM 6/21/98 -0400, Dru wrote:
=> >
=> >>Still need to know: How to use multiple commands in csh aliases. For
=> >>example, in .cshrc, there are alias lines letting you set up your own
=> >>commands. I haven't been able to figure out how to execute more than one
=> >>command at a time using an alias. I want to be able to format, label and
=> >>mount a floppy disk in one operation, but everything I've tried as far as
=> >>setting an alias like "dofloppy" that performs those three operations has
=> >>failed. I've had to break them up into separate aliases. Any clues from
=> >>csh experts out there? If not, I'll try freebsd-questions next.
=> >
=> >
=> >I'm no expert, but it sounds like you want a shell script, not an alias.
=> >This is covered in very good detail with many simple examples in the book
=> >Unix Unleashed in Chapter 13 under Aliases and Shell Scripts. Not trying
=> >to push the website, but I'm poor and the book is excellent. I shelved the
=> >Complete FreeBSD when it told me to use my favorite text editor to set up my
=> >ppp configuration files. Geez, I had had FreeBSD installed and running for
=> >less than 5 minutes and I already had a favorite text editor? Thus my
=> >introduction to Vi, but I digress and don't want to get you started on the
=> >vi thread again.
=> >
Regards,
Discover Rock Solid Kevin G. Eliuk
Discover FreeBSD
http://www.FreeBSD.Org
--==**==-- --==**==-- --==**==----==**==-- --==**==-- --==**==--
--==**==-- --==**==-- --==**==-- --==**==-- --==**==--
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-newbies" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980621160834.3498A-100000>
