Sponsored Content
Top Forums Shell Programming and Scripting delete spaces in the variable in unix script? Post 302103190 by blowtorch on Wednesday 17th of January 2007 02:16:35 AM
Old 01-17-2007
Unless you are using sh, go with tayyabq8's suggestion. It is more efficient than the others.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Strip leading and trailing spaces only in a shell variable with embedded spaces

I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help. echo $SH_VAR | command_line Syntax. The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies

2. Shell Programming and Scripting

delete white spaces

hi all... i have the next question: i have a flat file with a lot of records (lines). Each record has 10 fields, which are separated by pipe (|). My problem is what sometimes, in the first record, there are white spaces (no values, nothing) in the beginning of the record, like this: ws ws... (2 Replies)
Discussion started by: DebianJ
2 Replies

3. Shell Programming and Scripting

Delete spaces in between fields

I am new to unix and need some assistance. I have a file in the format below with about 15 fields per each record. I have 2 records displayed below. "1234","Andy ","Rich ","0001","123 Main Street ","Dallas " "2345","Andrew ","Richter ","0002","234 First Ave ... (12 Replies)
Discussion started by: guiguy
12 Replies

4. Shell Programming and Scripting

How can I stop the unix script from trimming extra spaces?

I have a file which contains certain records about users. the row length is always fixed to 205 characters. Now I want to read each record line from the file, substring some portion out of it and put into another file. But I have observed that my script is trimming the extra spaces I have used for... (4 Replies)
Discussion started by: Pramit
4 Replies

5. Shell Programming and Scripting

Remove spaces / tabs from variable in script

I want to remove extra spaces from variable in aix script. We retrieve the data from oracle database and then print the values. We have a value on 90th position. When we execute the query on sqlplus it shows the length of 90th position as 3, but when we use the same query in aix script it shows... (5 Replies)
Discussion started by: lodhi1978
5 Replies

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

7. Shell Programming and Scripting

No delete black spaces!

Hi, I have the next problem, i am triying to concatenate two variables with white spaces at the cornes, but the shell deletes them. For example i have the next code: A="Hello " B="Hello" echo $A$B output: Hello Hello You can see only one space between the words, and i put 5... (5 Replies)
Discussion started by: Xedrox
5 Replies

8. Shell Programming and Scripting

How to remove spaces between the columns in UNIX script?.

Hi guru's, I am trying to write a script to generate a csv file by connecting to database run a query and put the values into csv file. But the problem i face is i am getting lot of space after one value.how can i remove those values?. Please help. #!/bin/bash export... (2 Replies)
Discussion started by: karingulanagara
2 Replies

9. Shell Programming and Scripting

How to get a numeric value from Oracle to UNIX variable without spaces?

Hi, I am using the below code to get a numeric value from oracle to unix variable: BD_RC_CNT=`sqlplus -s ${WMD_DM_CONNECT} <<EOF set heading off set pagesize 0 Select count(*) from wmd_bad_data where proc_id = ${PROC_ID} and file_id = ${FILE_ID} and file_dt =... (7 Replies)
Discussion started by: Arun Mishra
7 Replies

10. Shell Programming and Scripting

How to remove leading and trailing spaces for variable in shell script?

Hi I have variable named tablename. The value to tablename variable has leading and trailing white spaces. How to remove the leading and training white spaces and write the value of the tablename without space to a file using shell script. ( for e.g. tablename= yyy ) INPUT ... (10 Replies)
Discussion started by: pottic
10 Replies
LDBRENAME(1)							  [FIXME: manual]						      LDBRENAME(1)

NAME
ldbrename - Edit LDB databases using your favorite editor SYNOPSIS
ldbrename [-h] [-o options] {olddn} {newdb} DESCRIPTION
ldbrename is a utility that allows you to rename trees in an LDB database based by DN. This utility takes two arguments: the original DN name of the top element and the DN to change it to. OPTIONS
-h Show list of available options. -H <ldb-url> LDB URL to connect to. See ldb(3) for details. -o options Extra ldb options, such as modules. ENVIRONMENT
LDB_URL LDB URL to connect to (can be overrided by using the -H command-line option.) VERSION
This man page is correct for version 4.0 of the Samba suite. SEE ALSO
ldb(3), ldbmodify, ldbdel, ldif(5) AUTHOR
ldb was written by Andrew Tridgell[1]. If you wish to report a problem or make a suggestion then please see the http://ldb.samba.org/ web site for current contact and maintainer information. This manpage was written by Jelmer Vernooij. NOTES
1. Andrew Tridgell http://samba.org/~tridge/ [FIXME: source] 04/19/2012 LDBRENAME(1)
All times are GMT -4. The time now is 12:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy