05-21-2003
or how about sed. x=`echo $i|sed s/.$//`
These 2 Users Gave Thanks to Optimus_P For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Here is a sample code
grep '903' -i user.txt | tail -2 | awk '{print $2}' | sed 's/B//g'
the input file has data as such
903-xxx-xxxxB
903-xxx-xxxxB
It is a dialer file i want to remove the "B"
any help thanks (5 Replies)
Discussion started by: Iz3k34l
5 Replies
2. Shell Programming and Scripting
Hello Experts,
I have a file "tt.txt" which is like:
#a1=a2
b1=b2
#c1=c2
I need to remove the pound (#) sign from a particular line. In this case let us assume it's 3rd line : "#c1=c2"
I can do it through:
sed "s/#c1=c2/c1=c2/" tt.txtbut it is possible that I may not know the value... (6 Replies)
Discussion started by: hkansal
6 Replies
3. UNIX for Advanced & Expert Users
Hi,
I am facing one interesting problem :
I have a file which contains data like this
459,|1998-11-047|a |b |c \n efg | d|e | \n
459,|1998-11-047|a \n c|b |c \n efg | d|e | \n
Basically what I have to do is , I have to remove all \n which is coming ( enclosed ) in between... (7 Replies)
Discussion started by: shihabvk
7 Replies
4. HP-UX
Hi Experts,
I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line.
File is comma (,) seperated.
Eg:
ID,Client ,SNo,Rank
37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies
5. Shell Programming and Scripting
Hi everyone,
I'm very new to using sed, run through some tutorials and everything but I've hit a problem that I'm unable to solve by myself.
I need to remove all linefeeds that are followed by a particular character (in this case a semicolon). So basically, all lines starting with a semicolon... (5 Replies)
Discussion started by: fluffdasheep
5 Replies
6. Shell Programming and Scripting
Hi,
I have a file with lines such as the below. I want to remove the comma only if it is the first character on a line. I can't work out how to do this using sed.
*ELSET, ELSET=WHEEL_TD2
63, 64, 65, 72, 82, 88, 89, 92, 120, 121, 152, 181, 190, 221, 252, 259
, 260, 282, 283, 285, 286,... (2 Replies)
Discussion started by: carlr
2 Replies
7. Shell Programming and Scripting
Good afternoon:
im working wih 2 files to find differences and use the cmp command
cmp file1 file2
file1 file2 are are diifferent char 302 line1
i found what the difference is with the sed command and that is the file1 at the end of every line has a (,) (comma) character.
i.e
sed -n... (4 Replies)
Discussion started by: alexcol
4 Replies
8. UNIX for Dummies Questions & Answers
Hi guys,
Does anyone know how to remove the last character in each of the line?
This is what I have:
ABCDE.1
GLSJD.2
HIJPL.2
HKAGB.3
IUBWQ.1
What I want (remove the dot and number):
ABCDE
GLSJD
HIJPL
HKAGB
IUBWQ
I tried to use this: sed 's/.*//'
But I'm not sure if that is... (3 Replies)
Discussion started by: narachaid
3 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
Could any one suggest how to remove $ symbol in a text file when i am opening in vi editor.
Scenario;
For example iam having a file name aaa.txt the data inside the file is like
sample
name
when i am opening in vi editor
The same file resembles like below when i am... (1 Reply)
Discussion started by: Chandru_Raj
1 Replies
10. Shell Programming and Scripting
Hi,
I am a newbie to shell scripting (.sh). Please guide me on how to do the below issue.
My input file has below data.
I want to remove $ sysmbol from the fourth column of each line. (ie, between 4th and 5th pipe symbol)
ABC25160|51497|06/02/2010|$32,192.07|MARK|$100|A... (3 Replies)
Discussion started by: rsreejithmenon
3 Replies
LEARN ABOUT HPUX
rc.config
rc.config(4) Kernel Interfaces Manual rc.config(4)
NAME
rc.config, rc.config.d - files containing system configuration information
SYNOPSIS
DESCRIPTION
The system configuration used at startup is contained in files within the directory The file sources all of the files within and and
exports their contents to the environment.
/etc/rc.config
The file is a script that sources all of the scripts, and also sources To read the configuration definitions, only this file need be
sourced. This file is sourced by whenever it is run, such as when the command is run to transition between run states. Each file that
exists in is sourced, without regard to which startup scripts are to be executed.
/etc/rc.config.d
The configuration information is structured as a directory of files, rather than as a single file containing the same information. This
allows developers to create and manage their own configuration files here, without the complications of shared ownership and access of a
common file.
/etc/rc.config.d/* Files
This is where files containing configuration variable assignments are located.
Configuration scripts must be written to be read by the POSIX shell, and not the Bourne shell, or In some cases, these files must also be
read and possibly modified by control scripts or the sam program. See sd(4) and sam(1M). For this reason, each variable definition must
appear on a separate line, with the syntax:
No trailing comments may appear on a variable definition line. Comment statements must be on separate lines, with the comment character in
column one. This example shows the required syntax for configuration files:
Configuration variables may be declared as array parameters when describing multiple instances of the variable configuration. For example,
a system may contain two network interfaces, each having a unique IP address and subnet mask (see ifconfig(1M)). An example of such a dec-
laration is as follows:
Note that there must be no requirements on the order of the files sourced. This means configuration files must not refer to variables
defined in other configuration files, since there is no guarantee that the variable being referenced is currently defined. There is no
protection against environment variable namespace collision in these configuration files. Programmers must take care to avoid such prob-
lems.
/etc/TIMEZONE
The file contains the definition of the environment variable. This file is required by POSIX. It is sourced by at the same time the files
are sourced.
SEE ALSO
rc(1M).
rc.config(4)