Hi
I need to find one string in all files and replace tht string with blank space and need to redirect all the files into the same directory again.
now i am using
find ./ -name "*.dmp" | xargs perl -pi -e 's/\\N//g' | sed 's/.$//g'
but now its not redirrecting properly .
its taking... (21 Replies)
I have a directory full of files. Most of the code in the files is the same accept for a few parameter values. I want to remove hard coded values and replace it with a parameter that I can pass. This is oracle pl/sql anonymous blocks. so the code is similiar to this
function myfunc
(p_myvar ... (1 Reply)
Hello,
I am very new to Linux and am trying to find a way for following problem.
I have a number of files in a folder as Export000.dat, Export001.dat ..and so on.
Each file has a string field 'Absolute velocity'. I want it to be replaced by 'Pixel shift' in all the files. I tried something like... (4 Replies)
I'm trying to remove the following string from several files.
<img heigth="1" width="1" border="0" src="http://myteenmovies.net/t.php?id=5540372">I'm using the following script
#!/bin/bash
# This script will search and replace all regular files for a string
# supplied by the user and... (1 Reply)
Hi All,
HP-UX oradev3 B.11.11 U 9000/800 3251073457
I have following files all contains text like "919642990137@". I need to search this text across all files and replace it with something like "919717298765@". I was wondering, how to accomplish this task?
cpmprod_status.sh... (8 Replies)
Hi there,
i got the following problem. i need a bash script to correct e-mail addresses in an csv. i got a huge csv like this
A B C D
heiner.holber.somewhere.ch heiner holber heiner.holber@somewhere.ch
So A is the wrong... (8 Replies)
What is the best way (bash/awk/sed?) to read in two text files and do a keyword search/replace?
file1.txt:
San Francisco
Los Angeles
Seattle
Dallas
file2.txt:
I love Los Angeles.
Coming to Dallas was the right choice.
San Francisco is fun.
Go to Seattle in the summer.
... (3 Replies)
Hello,
I have hundreds of files in which I need to change email address. Here is what I am trying to do:
1. All text files are in a directory "a"
2. In the text file, I want to replace email address for preparer. All these lines start with {{PreparerEmail and end with }}. The email... (3 Replies)
I have a bit of a complex problem that I would like to solve with awk. It is essentially a 2-part problem.
I have a large directory of files with the same format, each with 266 lines.
The first 206 lines of each file are filled with attribute information.
Then the following 60 lines consist... (4 Replies)
I am not sure how to search and replace the word in the few specific files.
I need to search and replace word in only the name containing pepsi in the filename. (12 Replies)
Discussion started by: ramkumar15
12 Replies
LEARN ABOUT DEBIAN
replcon
replcon(1) General Commands Manual replcon(1)NAME
replcon - SELinux file context replacement tool
SYNOPSIS
replcon NEW_CONTEXT DIR [OPTIONS] [EXPRESSION]
DESCRIPTION
replcon allows the user to find and replace file contexts. Replacements can be filtered by object class as described below.
REQUIRED ARGUMENTS
NEW_CONTEXT
The replacement context as expressed as a partial context, described below.
DIR Initial directory to begin searching. The tool will recurse into any subdirectories, so be sure there are no circular mounts within
it.
EXPRESSION
The following options allow the user to specify which files to find. A file must meet all specified criteria for its context to be
replaced. If no expression is provided, all files' contexts are replaced.
-t TYPE, --type=TYPE
Search for files with a context containing the type TYPE.
-u USER, --user=USER
Search for files with a context containing the user USER.
-r ROLE, --role=ROLE
Search for files with a context containing the role ROLE.
-m RANGE, --mls-range=RANGE
Search for files with a context with the MLS range of RANGE. Note that replcon ignores the SELinux translation library, if present.
In addition, this flag is ignored if DIR has no MLS information.
--context=CONTEXT
Search for files matching this partial context. This flag overrides -t, -u, -r, and -m.
-p PATH, --path=PATH
Search for files which include PATH.
-c CLASS, --class=CLASS
Search only files of object class CLASS.
OPTIONS -v, --verbose
Display context info during replacement.
-h, --help
Print help information and exit.
-V, --version
Print version information and exit.
PARTIAL CONTEXT
The --context flag and NEW_CONTEXT argument specify a partial context, which is a a colon separated list of user, role, and type. If the
system supports MLS, the context may have a fourth field that gives the range. With --context if a field is not specified or is the lit-
eral asterisk, then the query will always match the field. With NEW_CONTEXT if a field is not specified or is the literal asterisk, then
that portion of the context will not be modified.
OBJECT CLASSES
Valid object class strings are
block, char, dir, fifo, file, link, or sock.
NOTE
The replcon utility always operates on "raw" SELinux file contexts. If the system has an installed translation library (i.e., libsetrans),
those translations are ignored in favor of reading the original contexts from the filesystem.
EXAMPLES
replcon ::type_t: .
Replace every context's type in the current directory with type_t. The user and role portion remain unchanged.
replcon -u user_u *:role_r:* .
Replace every context's role with user user_u in the current directory with role_r. The user and type portion remain unchanged.
replcon --context ::type_t:s0 :::s0:c0 /tmp
Replace every context with type type_t and MLS range s0 in /tmp with MLS range s0:c0.
AUTHOR
This manual page was written by Jeremy A. Mowery <jmowery@tresys.com>.
COPYRIGHT
Copyright(C) 2003-2007 Tresys Technology, LLC
BUGS
Please report bugs via an email to setools-bugs@tresys.com.
SEE ALSO findcon(1), indexcon(1)replcon(1)