04-10-2008
Find and replace character in a string
Hi all,
My problem is the following:
I've a script that must list all files in a directory and write this information in a text file.
I've tried to get the list through ls command and then write it using msgecho
msgecho "`ls $PATH_APS_JOB_ORA`"
This works good but the created string is very long, having the line with all files in the list separated by a blank space.
Is it possible to store the ls results in a string variable, replace the space with \n and then write it into the text file?
In this way, the text file will be more and more clear...
I've read about sed and grep commands: is it possible to apply them to a string? How?
Thanks to all will help.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to change the first/or any character of a string to upper-case:
String:
test
Desired results:
Test or tEst or teSt or tesT
thanks (6 Replies)
Discussion started by: prkfriryce
6 Replies
2. Shell Programming and Scripting
Need to replace any control character in the string in perl
---------- Post updated at 04:22 PM ---------- Previous update was at 03:50 PM ----------
Any help !!!
Thanks in advance (2 Replies)
Discussion started by: hansini
2 Replies
3. Programming
Hi,
Could someone help me how to replace last character string.
For example
$>export T1=abcde
$>export T2=xyz
my question is how to get result abcdxyz?
Many Thanks (2 Replies)
Discussion started by: nicklau81
2 Replies
4. Shell Programming and Scripting
I have a string
-----
i want to replace the 3rd '-' with a character
How can i do that
Basically im trying to do hangman
I have added the '-----' string to a file called hash
and i have the character in a variable called $input
also i have the character location(index) in this variable... (12 Replies)
Discussion started by: omaral
12 Replies
5. Shell Programming and Scripting
Hello everyone this is my first post of many to come :)
I am writing a script and in this script at one point i need to replace a character in a particular position in a string for example:
in the string "mystery" i would need to replace the 3rd position to an "r" so the string becomes... (3 Replies)
Discussion started by: snipaa
3 Replies
6. Shell Programming and Scripting
I have a string eg.
word=promise
and I have the masked version of the word which is -------(7dash for each character)
if the user input a character O, I want the masked version of the word to be --o----
if the user inputs another character p, then the masked word becomes p-o----
How can i... (1 Reply)
Discussion started by: rajugurung
1 Replies
7. Shell Programming and Scripting
Hi Team,
i have 1st cloumn of data containing,
LAMSBA01-BA-COFF-YTD
LAMSBA01-BA-COFF-ITD
LAMSBA01-BA-AGGR-IND .
LAMSBA01-BA-CURR-COFF-BAL
i need to replace the "-" to "_" (underscore) using AWK .
please help me on this.
Thanks,
Baski (4 Replies)
Discussion started by: baskivs
4 Replies
8. Shell Programming and Scripting
Hi,
I am beginner to Shell Scripting.
I have a String like this "testabcdef", i need the first character as it is and the remaining character should be replaced by the the '*' character. e.g(t***********)
PLZ Suggest me. (5 Replies)
Discussion started by: nanthagopal
5 Replies
9. Shell Programming and Scripting
Hi,
i want find the character '-' in a file from position 284-298, if it occurs i need to replace it with 'O ' for the position in the file. How to do that using SED command.
thanks in advance,
Sara (9 Replies)
Discussion started by: Sara183
9 Replies
LEARN ABOUT HPUX
event_class
event_class(5) event_class(5)
NAME
event class file - The file that contains the declaration of an event class.
DESCRIPTION
Audit events can be logically grouped into event classes. Event classes are defined in event class files. An event class file contains an
event class number and a list of event numbers corresponding to audit events.
All event class files must be created in the dcelocal/etc/audit/ec directory.
The name of the event class file becomes the name of the event class. The recommended naming convention for event class files is:
dce_server-name_class
where class is a descriptive text that characterizes the event class.
Event class files must be write-protected by the local operating system (that is, only administrators should have write access to these
files). Audit clients read these files to maintain an event table in their address space.
Optionally, an event class file can contain a SEP line. This line contains a list of prefixes of the event numbers in the file. The SEP
line speeds up the scanning performed by the Audit clients. Audit clients which do not have events with one of the prefixes listed will
not scan the event list. If the SEP line is not provided in the file, Audit clients will have to read the entire file to find out if the
event class file contains any of their events.
Empty lines are ignored in the event class file.
Comments are designated by the number sign (#) placed before the comment text.
The Event Class File Format
The format of an event class file is: ECN=event_class_number SEP=prefix_1 prefix_2 ... # comments start with the number sign event_num-
ber_1 event_number_2
EXAMPLES
Following is an example of an event class file for the event class ec_local_authentication: ECN = 0x00000001 SEP = 0x100 # AS_Request
0x00000100 # TGS_TicketReq 0x00000101 # TGS_RenewReq 0x00000102 # TGS_ValidateReq 0x00000103
event_class(5)