Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Setting the Results of a Command to a Variable Post 302171780 by robotronic on Friday 29th of February 2008 02:00:12 PM
Old 02-29-2008
Code:
MYHOST=`hostname`
echo "$MYHOST"

 

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Setting a variable to result of FIND command

I am working on a batch script where a filter is placed on a directory, and the files that come out of that filter have to be copied into another directory. More specifically, I am trying to set the results of a FIND command to a variable, so that I may access this variable / file later. The... (2 Replies)
Discussion started by: JP Favara
2 Replies

2. Shell Programming and Scripting

store awk results in a variable

I try to get the month (of last save) and the filename into a variable, is this possible ? something like this : for month in `ls -la | awk '{print $6}'` do if ] then a=filename of the matching file cp $a /Sep fi thanks, Steffen (1 Reply)
Discussion started by: forever_49ers
1 Replies

3. Shell Programming and Scripting

Grep results to store in a shell variable

I have the results of a grep with -n store in a shell variable ie VAR=`grep -n -e 'PATTERN' file` How ever I am missing the line breaks in the variable , How do I store the resualts of grep with many lines in to a variables. I want the varable should be the sawmway as we do the grep grep... (3 Replies)
Discussion started by: jojan
3 Replies

4. UNIX for Dummies Questions & Answers

putting grep -c results number in a variable

I want to display "no results found" if a grep search of a name that the user inputs is not found anywhere in a certain file, Right now I have this, but doesn't seem to work. Im not sure what to change. read name results=grep -c $name file if ; then echo "No results found." exit... (1 Reply)
Discussion started by: busdude
1 Replies

5. UNIX for Dummies Questions & Answers

how to - redirect query results to a variable

How can I send the results of a query to a unix variable. I basically want to run a query then do some logic on the results. Trying to redirect the result into a variable I define in the script. select count(*) as counter from table - nut to redirect the "count" returned from the query... (2 Replies)
Discussion started by: rstone
2 Replies

6. Shell Programming and Scripting

Adding grep'd results in a variable

Here is one I am baffled with; I have not used unix for a while and now that I am back it has been fun remembering and I have enjoyed it, for the most past. this is in ksh. I need to search in a file for the line with X1 and cut columns 20-25, put them into a variable, added them (dollar... (3 Replies)
Discussion started by: CougarMutt
3 Replies

7. UNIX for Advanced & Expert Users

Place the results of a CUT command into a variable

I am being passed a file in UNIX, ie: variable.txt I need to extract the first part of the file content, up to the period, content ie: common_dir.second_output cut -d'.' -f1 /content/stores/variable.txt I then need to utilize the results to create a variable ($1), and test on that... (4 Replies)
Discussion started by: talonbow
4 Replies

8. Programming

Results Of A Variable Into An Array Using C Language

Can C add its results into an array like bash? For example using bash: cat /etc/passwd **truncated for space ** gdm:x:109:118:Gnome Display Manager:/var/lib/gdm:/bin/false mysql:x:110:122:MySQL Server,,,:/nonexistent:/bin/false statd:x:111:65534::/var/lib/nfs:/bin/false... (5 Replies)
Discussion started by: metallica1973
5 Replies

9. Shell Programming and Scripting

awk - saving results of external script to variable.

So, I've been playing with speeding up some analysis we do by using multiple threads of awk (actually, mawk, but code-compatible as far as I use it) on multiple CPU cores. So, I have a big data file and I have several copies of exactly the same processor script, written in mawk. I also have a... (8 Replies)
Discussion started by: treesloth
8 Replies

10. Shell Programming and Scripting

I want to add a variable for the results from the formula of one variable and results of another var

Good morning all, This is the file name in question OD_Orders_2019-02-19.csv I am trying to create a bash script to read into files with yesterdays date on the file name while retaining the rest of the files name. I would like for $y to equal, the name of the file with a formula output with... (2 Replies)
Discussion started by: Ibrahim A
2 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 04:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy