Sponsored Content
Operating Systems OS X (Apple) .local hostname available as an environmental variable? Post 302555710 by gentinphilly on Thursday 15th of September 2011 11:05:27 AM
Old 09-15-2011
Thanks Andrew, as it turns out there is a new to me command scutil taht I can use to grab the localhostname -- scutil --get LocalHostName -- easy enough to pop into the script.

Many thanks for your thoughts & assistance here!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Set Oracle Environmental Variable !!

Can someone send me a shell script to set all Oracle environment variable which is working. I have the following script which works but not 100%. Please advice what you think is wrong. if # Command executed from a terminal then ORACLE_SID="" ... (4 Replies)
Discussion started by: uuser
4 Replies

2. Shell Programming and Scripting

Environmental Variable

Hi, I'm exporting an environmental variable from a C program using putenv function. I'm calling the exe of the C program from shell script. But when I display the environmental variables from the Shell script, My varaible is not getting displayed. Can anyone please tell me how to get it in... (2 Replies)
Discussion started by: janemary.a
2 Replies

3. Shell Programming and Scripting

setting ksh environmental variable

Hi, I have problem setting up environmental variables. The idea is to start with main.ksh script that will run setting.ksh, and in side of it I'll set up variables. Please take a look at my code, and help me to find my mistake. Thanks, Mila Main.ksh look like this: #!/usr/bin/ksh #... (2 Replies)
Discussion started by: mefquik
2 Replies

4. UNIX for Dummies Questions & Answers

How does the PATH environmental variable work?

Hello. I have a question about how the PATH environment variable works. I wrote a script in $HOME/bin/gvim. I want it to be called instead of /usr/bin/gvim, so I've placed it before in the PATH. However, it is still the old one that is found. If I open an other terminal, I have the... (6 Replies)
Discussion started by: qwer
6 Replies

5. Shell Programming and Scripting

How to get the value of a variable which is having another value in environmental script?

Dear Folks, I am facing an issue in getting a value of a variable.Let me explain the scenario. I am having a list file say files.list in which I have mentioned 1 FILE1 2 FILE2 Then I am having an set_env.ksh in which I mentioned FILE1=/clocal/data/user/userdata.txt... (4 Replies)
Discussion started by: dinesh1985
4 Replies

6. Shell Programming and Scripting

Setting Environmental Variable

I have a request from a programmer to set an env variable for him. I know how to do it for bash shell by adding the following line to .bash_profile export $VAR=/home/code/project/ But this will be applicable only when he is in his bash shell. What is the procedure to be followed to make... (2 Replies)
Discussion started by: Tuxidow
2 Replies

7. Shell Programming and Scripting

Setting environmental variable for all the users in the box

Hi, I have Sun solaris x64 box in which i need to set a Environment variable for all the users in the box. This Environment varible is used by the application on the box. Could any one please help me in setting the Environment variable. Thanks, Firestar (6 Replies)
Discussion started by: firestar
6 Replies

8. UNIX for Advanced & Expert Users

Environmental variable

i want to set environmental variables in solaris and redhat. it should show the current directory and the default shell should be bourne shell. along with it should show the hostname.. like this hostname{/home/vipin/data}# ifconfig Thanks in advanced.:wall: Please use code tags.... (1 Reply)
Discussion started by: vipinkumarr89
1 Replies

9. Shell Programming and Scripting

Clearing a environmental variable

i set a variable from the command line: export GANG="james,roy,martin" i can access this variable ($GANG) from a script. but each time i run the script, the variable keeps getting bigger. more info keeps getting added to it. Is there anyway i can make the $GANG variable contain the... (3 Replies)
Discussion started by: SkySmart
3 Replies

10. Shell Programming and Scripting

Issue with cron and environmental variable

My shell script it.sh.I am calling bip.sh from it.sh #!/bin/sh ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH today=`date "+%m-%d-%Y %H:%M:%S"`; export today CUR_DIR=$1; export CUR_DIR LOG_FILE=$CUR_DIR/error.log;... (4 Replies)
Discussion started by: rafa_fed2
4 Replies
SCUTIL(8)						    BSD System Manager's Manual 						 SCUTIL(8)

NAME
scutil -- Manage system configuration parameters SYNOPSIS
scutil scutil --prefs [preference-file] scutil -r [-W] { nodename | address | local-address remote-address } scutil -w dynamic-store-key [-t timeout] scutil --get pref scutil --set pref [newval] scutil --dns scutil --proxy scutil --nc nc-arguments DESCRIPTION
Invoked with no options, scutil provides a command line interface to the "dynamic store" data maintained by configd(8). Interaction with this data (using the SystemConfiguration.framework SCDynamicStore APIs) is handled with a set of commands read from standard input. A list of the available commands is available by entering the help directive. The --prefs option provides a command line interface to the [raw] stored preference data. Interaction with this data (using the SystemCon- figuration.framework SCPreferences APIs) is handled with a set of commands read from standard input. A list of the available commands is availble by entering the help directive. The -r option provides a means of checking the network reachability of a host, an IP address, or a pair of local and remote IP addresses. Network "reachability" is a term that indicates whether network communication is possible between the current host and the specified host. The -w option provides a means of checking for (and optionally waiting for the creation of or posting of a notification to) a dynamic store key. The --get and --set options provide a means of reporting and updating a select group of persistent system preferences. The --dns option reports the current DNS configuration. The first listed resolver(5) configuration is considered to be the "default" config- uration. Additional "supplemental" configurations follow. Those containing a "domain" name will be used for queries matching the specified domain. Those without will be used as a "default" configuration in addition to the first listed. The --proxy option reports the current system proxy configuration. The --nc option provides a set of commands for monitoring and interacting with VPN connections. Use --nc help for a full list of commands. OPTIONS
-r [-W] { nodename | address | local-address remote-address } Check the network reachability of the specified host name, IP address, or a pair of local and remote IP addresses. One or more of the following strings will be reported to standard output. Not Reachable The specified nodename/address cannot be reached using the current network configuration. Reachable The specified nodename/address can be reached using the current network configuration. Transient Connection The specified nodename/address can be reached via a transient (e.g. PPP) connection. Connection Required The specified nodename/address can be reached using the current network configuration but a connection must first be established. As an example, this status would be returned for a dialup connection that was not currently active but could handle network traffic for the target system. Connection Automatic The specified nodename/address can be reached using the current network configuration but a connection must first be established. Any traffic directed to the specified name/address will initiate the connection. Local Address The specified nodename/address is one associated with a network interface on the system. Directly Reachable Addresss Network traffic to the specified nodename/address will not go through a gateway but is routed directly to one of the interfaces on the system. The reachability can also be monitored by specifying the -W (watch) option. This will result in the current status being reported as well as the status when/if the network configuration changes. A zero exit status will be returned when the reachability status is reported correctly. A non-zero exit status will be returned if errors are detected with an error reported to standard error. -w dynamic-store-key [-t timeout] Check if the specified key exists in the "dynamic store" data maintained by configd(8). If present, scutil will return with a zero exit status. If not present, scutil will wait for the specified time for data to be associated with or a notification to be posted using the key. A non-zero exit status will be returned if the key was not created/posted within the specified time. scutil will wait indefinitely if a timeout of 0 seconds is specified. The default timeout is 15 seconds. --get pref Retrieves the specified preference. The current value will be reported on standard output. Supported preferences include: ComputerName The user-friendly name for the system. LocalHostName The local (Bonjour) host name. HostName The name associated with hostname(1) and gethostname(3). --set pref [newval] Updates the specified preference with the new value. If the new value is not specified on the command line then it will be read from standard input. Supported preferences include: ComputerName LocalHostName HostName The --set option requires super-user access. --dns Reports the current DNS configuration. --proxy Reports the current proxy configuration. --nc nc-arguments Provides a set of commands for monitoring and interacting with VPN connections. Use --nc help for a full list of commands. SEE ALSO
configd(8) HISTORY
The scutil command appeared in Mac OS X Public Beta. Mac OS X January 23, 2008 Mac OS X
All times are GMT -4. The time now is 05:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy