Sponsored Content
Top Forums Shell Programming and Scripting How to trim space in output variable ? Post 74468 by vj_76 on Friday 10th of June 2005 02:31:28 AM
Old 06-10-2005
How to trim space in output variable ?

Hi ,
I have a code like this:

uid=scott
password=tiger
database=db01

cat >runid_val.sql<<-EOA
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
SELECT trim(runid_seq.nextval) FROM dual;
EXIT
EOA
echo `cat runid_val.sql`
V_RUNID=`sqlplus -s $uid/$password@$database @runid_val.sql`
echo V_RUNID:$V_RUNID

rundsjob -param runid=$V_RUNID
exit

I need to use this variable value in next command as shown above but its adding a space to out variable:
rundsjob -param runid= 26
and I wants like this: rundsjob -param runid=26

CAN ANYONE TELL ME HOW TO REMOVE THE SPACE in $V_RUNID?

Thanks & Regards,
VJ
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to merge two variable in one variable with space between them?

Dear all I had two separate variable. Now i want to make them merge into one new variable with space between them. Kindly suggest me. var1=dec 15 var2=10 i want var3=dec 15 10 My main aim is as below: op of date command: >date >Sat Dec 15 10:17:35 IST 2007 i want only Dec... (2 Replies)
Discussion started by: jaydeep_sadaria
2 Replies

2. Programming

How to trim the white space around a string in C program

I am coding a C program to read a plain text file. There are a lot of blank fields or a string with white spaces. I want to know is there such a function called trim() in C to clean the white space around a string? Or some other way can do this efficiently? Thanks. (18 Replies)
Discussion started by: hxm1303
18 Replies

3. Shell Programming and Scripting

Using Variable With Space In It?

Hey , I'm new to Bash and am having trouble with writing a script. I have a variable and want to use it to create a tar file, but, I am having problems. Can anyone tell me what I'm doing wrong? filestr=`date "+%y-%m-%d %H.%M.%S"`.tar tar -cvf $filestr test.txt So, basically,... (3 Replies)
Discussion started by: beefeater267
3 Replies

4. Shell Programming and Scripting

How to trim variable in linux?

Hi guys , I m developing a script in linux.but getting confused about how would i trim my variable if there is any space. for example. I m storing value in a variable named MACHINE_NAME if MACHINE_NAME=<space><space><space>ABCDF<space><space> How would i trim it to have my MACHINE_NAME=ABCDF... (5 Replies)
Discussion started by: pinga123
5 Replies

5. Shell Programming and Scripting

trim spaces in unix for variable

HI Guys I have written a script using awk to split a file based on some identifier and renaming the file based on two values from specific length. ts a fixed width file. When I am trying to fetch the values a = substr($0,11,10) b = substr($0,21,5); i am getting spaces in a and b values .... (6 Replies)
Discussion started by: manish8484
6 Replies

6. Shell Programming and Scripting

awk - trim white space from a field / variable

Hi, Consider the data (FS = |): 1| England |end 2| New Zealand |end 3|Australia|end 4| Some Made Up Country |end 5| West Indies|end I want the output to be (i.e. without the leading and trailing white space from $2) England New Zealand Australia Some Made Up Country West... (4 Replies)
Discussion started by: Storms
4 Replies

7. Shell Programming and Scripting

Trim sed output & assign to variable

Hi, I have the following command that parses an xml file to read a node <port>'s value. Hoever the output comes with spaces. My requirement is to trim the spaces around the value and assign to a variable. sed -n 's|<port>\(.*\)</port>|\1|p' ../cfg.xml How do I go about it? (6 Replies)
Discussion started by: sai2013
6 Replies

8. 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

9. Shell Programming and Scripting

Trim Space

In Shell, I have output of a unix command as test1 test2015 but I want it as test1 test2015 can anyone help me out. Use code tags, thanks. (3 Replies)
Discussion started by: OscarS
3 Replies

10. Shell Programming and Scripting

Gawk --- produce the output in pattern space instead of END space

hi, I'm trying to calculate IP addresses and their respective calls to our apache Server. The standard format of the input is HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST... (2 Replies)
Discussion started by: busyboy
2 Replies
GAMMU-SMSD-ODBC(7)						       Gammu							GAMMU-SMSD-ODBC(7)

NAME
gammu-smsd-odbc - gammu-smsd(1) backend using ODBC abstraction layer to use any supported database as a message storage DESCRIPTION
New in version 1.29.92. ODBC backend stores all data in any database supported by ODBC, which parameters are defined by configuration (see gammu-smsdrc for description of configuration options). For tables description see gammu-smsd-tables. This backend is based on gammu-smsd-sql. SUPPORTED DRIVERS
On Microsoft Windows, Gammu uses native ODBC, on other platforms, unixODBC can be used. LIMITATIONS
Due to limits of the ODBC interface, you might have to tweak SQL queries to work in used SQL server, see SQL Queries for more details. Partially this can be configured using SQL. CONFIGURATION
Before running gammu-smsd you need to create necessary tables in the database. You can use examples given in database specific backends parts of this manual to do that. You specify data source name (DSN) as Host in gammu-smsdrc. The data source is configured depending on your platform. On Microsoft Windows, you can find instructions on Microsoft website: http://support.microsoft.com/kb/305599 For unixODBC this is documented in the user manual: http://www.unixodbc.org/doc/UserManual/ EXAMPLE
Example configuration: [smsd] service = sql driver = odbc host = dsn_of_your_database sql = sql_variant_to_use user = username password = password See also gammu-smsdrc AUTHOR
Michal iha <michal@cihar.com> COPYRIGHT
2009-2012, Michal iha <michal@cihar.com> 1.31.90 February 24, 2012 GAMMU-SMSD-ODBC(7)
All times are GMT -4. The time now is 05:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy