Jump to content

% hostname ... huh??


Guest theeldergeek

Recommended Posts

Posted (edited)

Ignore the "%" :)

 

hostname

 

EDIT:

just as a matter of interest, I see "%" before linux commands on a lot of websites, anybody know why this is used? I always presumed it was just to shorthand for terminal

Edited by LosOjos
Additional Info
Guest theeldergeek
Posted
Ignore the "%" :)

 

hostname

 

:doh:

 

:getmecoat:

Posted
:doh:

 

:getmecoat:

 

Also, I can't see on my linux netbook what the result would be as I'm not connected to a server, but I think you need to run

 

hostname -f

 

to get the FQDN

Posted (edited)

Hi

 

@ macshinobi

 

DMCoy is on the right lines. For a brief explanation and possibly some links:

 

Shell Programming!

 

If you want to learn Shell Scripting this is a good place to start:

 

Advanced Bash-Scripting Guide

 

I've not read it all (it's rather large) but I would not be surprised if the Tee-Cee and Korn shells are in there somewhere? Different shells have different strengths and are good at achieving certain things depending on what you want. The Bourne Again Shell (bash) which is predominantly used on OSX is a good all rounder but it's not the only shell available. For example keying in "tcsh" (minus quotes) in Terminal will put you in the Tee-Cee Shell. You know when you're in tcsh because the percent sign will follow the username. The bash shell uses the dollar sign. Keying "ksh" presents the dollar sign and nothing else. Keying "bash" gets you back again. To find out more from the command line itself simply launch Terminal and key in:

 

man bash (for the Bourne Again Shell)

man tcsh (for the Tee-Cee Shell)

man ksh (for the Korn Shell)

 

No doubt there are plenty of other shells/programming environments (the POSIX World is vast) which may or may not be available in OSX. Half the "fun" is discovering them for yourself. A fairly general rule of thumb is if there is a downloadable binary available you should be able to "make/compile" on OSX. Macports and fink are two examples. This would also be true of Linux. A good resource for UNIX on OSX is here:

 

Apple - Support - Discussions - Unix

 

Antonio Rocco (ACSA)

Edited by AntonioRocco

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...