TIP: Click on subject to list as thread! ANSI
echo: muffin
to: Wes Garland
from: Roy J. Tellason
date: 2003-06-16 04:06:36
subject: Maximus at UNIX

Wes Garland wrote in a message to Roy J. Tellason:

 WG> preface: sorry for the crappy format, I lost my connection to
 WG> juge.com halfway through writing this (damn internet!)
 WG>  
 RJT> I have not done near enough with bash to know what the heck I'm 
 RJT> doing,  but thought that perhaps passing it a 
 RJT> parameter would work by changing that one line to

 RJT> for file in $1

 RJT> Does that look like it'd work?

(Much good stuff snipped...)

 WG> 38: while [ "$1" ]
 WG> 39: do
 WG> 40:   echo $file
 WG> 41:   shift
 WG> 42: done

I thought after I'd posted that message that perhaps a "shift" in
there someplace would be a good idea,  too.  :-)

 WG> 44: Oh -- the shift command shifts all the arguments left one
 WG> position, and 45: erases $1.

Yep,  used in dos batch files too,  though I've never used it.



 RJT> And somehow I ended up with a file named a.out?  I 
 RJT> didn't think that was even still being used!  Oh 
 RJT> well...

 WG> Remember, backwards compatibility has always been very important in
 WG> the UNIX world. :)

I have a book on c programming around here someplace that actually talks
about dealing with c under the unix environment,  and that's where I'd
heard of a.out in the first place.  Dunno where that book is,  offhand, 
though.  I was thinking that the ELF binary thing sorta obsoleted that, 
but I guess I still have a lot to learn about doing things on that
platform.

I didn't expect it to link for me,  either,  without explicitly telling it
to do so,  but apparently it did.  And that file seems to be flagged as
executable...

 WG> TO specify the name of your output file, use '-o filename'.

Noted.  I went all through man cc and didn't catch that one.  

--- 
* Origin: TANSTAAFL BBS 717-838-8539 (1:270/615)
SEEN-BY: 633/267 270
@PATH: 270/615 150/220 379/1 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.