Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Not able to get value in the variable Post 302253216 by mamta on Friday 31st of October 2008 07:49:39 AM
Old 10-31-2008
Quote:
Originally Posted by cv_pan
you can use -x option to get just the result.


db2 => pq5 @ /home/pq5$ db2 -x "select current timestamp from sysibm.sysdummy1 with ur"
2008-10-30-15.19.18.175721


also when getting this value into a valriable use ``.
$ABC=`db2 -x "select current timestamp from sysibm.sysdummy1 with ur"`

Thanks cv_pan it has sorted out my problem
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh: A part of variable A's name is inside of variable B, how to update A?

This is what I tried: vara=${varb}_count (( vara += 1 )) Thanks for help (4 Replies)
Discussion started by: pa3be
4 Replies

2. Shell Programming and Scripting

Sed variable substitution when variable constructed of a directory path

Hello, i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem. my var1 is a string constructed like this: filename1 filerev1 filepath1 my var2 is another string constructed like this: filename2 filerev2 filepath2 when i do... (2 Replies)
Discussion started by: alrinno
2 Replies

3. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

4. Shell Programming and Scripting

How to define a variable with variable definition is stored in a variable?

Hi all, I have a variable say var1 (output from somewhere, which I can't change)which store something like this: echo $var1 name=fred age=25 address="123 abc" password=pass1234 how can I make the variable $name, $age, $address and $password contain the info? I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies

5. Shell Programming and Scripting

Split variable length and variable format CSV file

Dear all, I have basic knowledge of Unix script and her I am trying to process variable length and variable format CSV file. The file length will depend on the numbers of Earnings/Deductions/Direct Deposits. And The format will depend on whether it is Earnings/Deductions or Direct Deposits... (2 Replies)
Discussion started by: chechun
2 Replies

6. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

7. Shell Programming and Scripting

Variable not found error for a variable which is returned from stored procedure

can anyone please help me with this: i have written a shell script and a stored procedure which has one OUT parameter. now i want to use that out parameter as an input to the unix script but i am getting an error as variable not found. below are the unix scripts and stored procedure... ... (4 Replies)
Discussion started by: swap21783
4 Replies

8. Red Hat

How to pass value of pwd as variable in SED to replace variable in a script file

Hi all, Hereby wish to have your advise for below: Main concept is I intend to get current directory of my script file. This script file will be copied to /etc/init.d. A string in this copy will be replaced with current directory value. Below is original script file: ... (6 Replies)
Discussion started by: cielle
6 Replies

9. Shell Programming and Scripting

[Solved] How to increment and add variable length numbers to a variable in a loop?

Hi All, I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies

10. UNIX for Advanced & Expert Users

Passing variable as input & storing output in other variable

I have a below syntax its working fine... var12=$(ps -ef | grep apache | awk '{print $2,$4}') Im getting expected output as below: printf "%b\n" "${VAR12}" dell 123 dell 456 dell 457 Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
BOS_GETRESTART(8)					       AFS Command Reference						 BOS_GETRESTART(8)

NAME
bos_getrestart - Displays the automatic restart times for server processes SYNOPSIS
bos getrestart -server <machine name> [-cell <cell name>] [-noauth] [-localauth] [-help] bos getr -s <machine name> [-c <cell name>] [-n] [-l] [-h] DESCRIPTION
The bos getrestart command displays two restart times from the /etc/openafs/BosConfig file on the server machine named by the -server argument: o The general restart time at which the BOS Server process automatically restarts itself and all processes marked with status "Run" in the BosConfig file. The default is Sunday at 4:00 a.m. o The binary restart time at which the BOS Server automatically restarts any process for which the time stamp on the binary file in the /usr/lib/openafs directory is later than the last restart time for the process. The default is 5:00 a.m. Use the bos getdate command to list a binary file's timestamp, and the -long flag to the bos status command to display a process's most recent restart time. Use the bos setrestart command to set the restart times. OPTIONS
-server <machine name> Indicates the server machine for which to display the restart times. Identify the machine by IP address or its host name (either fully- qualified or abbreviated unambiguously). For details, see bos(8). -cell <cell name> Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see bos(8). -noauth Assigns the unprivileged identity "anonymous" to the issuer. Do not combine this flag with the -localauth flag. For more details, see bos(8). -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The bos command interpreter presents the ticket to the BOS Server during mutual authentication. Do not combine this flag with the -cell or -noauth options. For more details, see bos(8). -help Prints the online help for this command. All other valid options are ignored. OUTPUT
The output consists of two lines: Server <machine_name> restarts at <time> Server <machine_name> restarts for new binaries at <time> Possible values for <time> include: o "never", indicating that the BOS Server never performs that type of restart. o "now", indicating that the BOS Server performs that type of restart only each time it restarts. o A specified day and time, indicating that the BOS Server performs that type of restart once per week. Example: "sun 4:00 am". o A specified time, indicating that the BOS Server performs that type of restart once per day. Examples: "11:00 pm", "3:00 am". EXAMPLES
The following example displays the restart times for the machine "db2.abc.com": % bos getrestart db2.abc.com Server db2.abc.com restarts at sun 4:00 am Server db2.abc.com restarts for new binaries at 2:15 am In the following example, the issuer abbreviates the machine name "fs1.abc.com" to "fs1", relying on the cell's name server to resolve the name. The output echoes the abbreviated form. % bos getrestart fs1 Server fs1 restarts at sat 5:00 am Server fs1 restarts for new binaries at 11:30 pm PRIVILEGE REQUIRED
None SEE ALSO
BosConfig(5), KeyFile(5), bos(8), bos_getdate(8), bos_setrestart(8), bos_status(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BOS_GETRESTART(8)
All times are GMT -4. The time now is 03:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy