Sponsored Content
Operating Systems OS X (Apple) .local hostname available as an environmental variable? Post 302555581 by gentinphilly on Thursday 15th of September 2011 06:30:41 AM
Old 09-15-2011
.local hostname available as an environmental variable?

Hola -

I've got a script for logon which populates a database with some info when a user logs on so that we can tell how many public terminals are in use & show users which ones are free. However, the machines are DHCPed and so using $HOSTNAME gives me an unstable name for them since of course the leases may change.

Is it possible to determine the .local hostname programatically and put it into an environmental variable I can call? We don't have too terribly many of these so that if I had to set an variable for each one by hand & call that I could do so, but of course, I'm hoping the .local name is available to me somehow.

Many thanks for any help or pointers here, greatly appreciated.
 

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
myproxy-info(1) 						      MyProxy							   myproxy-info(1)

NAME
myproxy-info - display information about MyProxy credentials SYNOPSIS
myproxy-info [ options ] DESCRIPTION
The myproxy-info command displays information about a user's credentials previously stored on a myproxy-server(8) using myproxy-init(1). The user must have a valid proxy credential as generated by grid-proxy-init or retrieved by myproxy-logon(1) when running this command. The myproxy-info command provides information only for credentials stored in the myproxy-server(8) credential repository using myproxy- init(1). In the case where the myproxy-server(8) is acting as a Certificate Authority, issuing end entity credentials via the myproxy- logon(1) command, the myproxy-info command will return "no credentials found". OPTIONS
-h, --help Displays command usage text and exits. -u, --usage Displays command usage text and exits. -v, --verbose Enables verbose debugging output to the terminal. -V, --version Displays version information and exits. -s hostname[:port], --pshost hostname[:port] Specifies the hostname(s) of the myproxy-server(s). Multiple hostnames, each hostname optionally followed by a ':' and port number, may be specified in a comma-separated list. This option is required if the MYPROXY_SERVER environment variable is not defined. If specified, this option overrides the MYPROXY_SERVER environment variable. If a port number is specified with a hostname, it will override the -p option as well as the MYPROXY_SERVER_PORT environment variable for that host. -p port, --psport port Specifies the TCP port number of the myproxy-server(8). Default: 7512 -l username, --username username Specifies the MyProxy account to query. By default, the command uses the value of the LOGNAME environment variable. Use this option to specify a different account username on the MyProxy server. The MyProxy username need not correspond to a real Unix user- name. -d, --dn_as_username Use the certificate subject (DN) as the default username, instead of the LOGNAME environment variable. -k name, --credname name Specifies name of the credential to query. If not specified, the command displays all credentials associated with the MyProxy user- name. EXIT STATUS
0 on success, >0 on error ENVIRONMENT
GLOBUS_GSSAPI_NAME_COMPATIBILITY This client will, by default, perform a reverse-DNS lookup to determine the FQHN (Fully Qualified Host Name) to use in verifying the identity of the server by checking the FQHN against the CN in server's certificate. Setting this variable to STRICT_RFC2818 will cause the reverse-DNS lookup to NOT be performed and the user-specified name to be used instead. This variable setting will be ignored if MYPROXY_SERVER_DN (described later) is set. MYPROXY_SERVER Specifies the hostname(s) where the myproxy-server(8) is running. Multiple hostnames can be specified in a comma separated list with each hostname optionally followed by a ':' and port number. This environment variable can be used in place of the -s option. MYPROXY_SERVER_PORT Specifies the port where the myproxy-server(8) is running. This environment variable can be used in place of the -p option. MYPROXY_SERVER_DN Specifies the distinguished name (DN) of the myproxy-server(8). All MyProxy client programs authenticate the server's identity. By default, MyProxy servers run with host credentials, so the MyProxy client programs expect the server to have a distinguished name with "/CN=host/<fqhn>" or "/CN=myproxy/<fqhn>" or "/CN=<fqhn>" (where <fqhn> is the fully-qualified hostname of the server). If the server is running with some other DN, you can set this environment variable to tell the MyProxy clients to accept the alternative DN. Also see GLOBUS_GSSAPI_NAME_COMPATIBILITY above. MYPROXY_TCP_PORT_RANGE Specifies a range of valid port numbers in the form "min,max" for the client side of the network connection to the server. By default, the client will bind to any available port. Use this environment variable to restrict the ports used to a range allowed by your firewall. If unset, MyProxy will follow the setting of the GLOBUS_TCP_PORT_RANGE environment variable. X509_USER_CERT Specifies a non-standard location for the certificate to be used for authentication to the myproxy-server(8). X509_USER_KEY Specifies a non-standard location for the private key to be used for authentication to the myproxy-server(8). X509_USER_PROXY Specifies a non-standard location for the proxy credential to be used for authentication to the myproxy-server(8). X509_CERT_DIR Specifies a non-standard location for the CA certificates directory. AUTHORS
See http://myproxy.ncsa.uiuc.edu/about for the list of MyProxy authors. SEE ALSO
myproxy-change-pass-phrase(1), myproxy-destroy(1), myproxy-get-trustroots(1), myproxy-init(1), myproxy-logon(1), myproxy-retrieve(1), myproxy-store(1), myproxy-server.config(5), myproxy-admin-adduser(8), myproxy-admin-change-pass(8), myproxy-admin-load-credential(8), myproxy-admin-query(8), myproxy-server(8) MyProxy 2009-12-1 myproxy-info(1)
All times are GMT -4. The time now is 07:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy