Re: truncate the hostname of local computer
Re: truncate the hostname of local computer
- Subject: Re: truncate the hostname of local computer
- From: Andrew Oliver <email@hidden>
- Date: Fri, 10 Dec 2004 09:54:32 -0800
On 12/9/04 4:13 PM, "Steve Ingram" <email@hidden> wrote:
>
> Our computers have the computer name set to eight characters - three
> letters followed by five numbers. Example: ghs27038
>
> In a script we are using to reset the computer name I have the line:
>
> set computerNameNoChange = `/bin/hostname`
>
> This gives me a value of ghs27038.local
>
> This is close to what I want. How do I get computerNameNoChange to
> equal only the first eight characters of /bin/hostname ?
>
> More precisely, how do I get computerNameNoChange to be the value of
> the current computer name, without the ".local" added?
To me, the obvious answer seems to be covered in `man hostname`:
> Options:
>
> -s Trim off any domain information from the printed name.
So surely:
set computerNameNoChange = `/bin/hostname -s`
does what you want, no?
(not that any of this is related to AppleScript... ;) )
Andrew
:)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden