12-04-2008
Or simply with tr. Check the -d option in the man page.
Regards
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
How do I remove the lines where special characters or Unicode characters appear?
The following query does work but I wonder if there is a better way.
cat test.txt | egrep -v '\)|#|,|&|-|\(|\\|\/|\.'
The following lines show that my query is incomplete.
Warning: The word "*Khan" is... (1 Reply)
Discussion started by: shantanuo
1 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
I have a script written that creates a new directory within the shell program and if a parameter isn't passed in, it creates a strange directory name by mistake. So I have a directory like "-_12" and I am unable to remove it. I tried removing it using double quote and many others. I have... (12 Replies)
Discussion started by: datherriault
12 Replies
3. Shell Programming and Scripting
Hello,
Is there a simpler way to remove special characters (color codes) from each lines in a log file?
I use sed like in the example below but I think there should be a more simple way to achieve the same result:
$ cat -vet file1
^, , , ,
Maybe to convert the file somehow?
... (5 Replies)
Discussion started by: majormark
5 Replies
4. UNIX for Dummies Questions & Answers
Dear Members,
We have a file which contains some special characters. I need to replace these special character by a new line character(\n).
The Special character is \x85.
I am not sure what this character means and how we can remove it.
Any inputs are greatly appreciated.
Thanks... (5 Replies)
Discussion started by: sandeep_1105
5 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a directory that has a file which contained special characters in the filename. Can someone please advise how to remove the file, preferably with a rm -i ?
Thanks in advance.
Listing is as below:
{oracle}> ls -1b
bplog.bkup.001
bplog.bkup.002
bplog.bkup.003
bplog.bkup.004... (1 Reply)
Discussion started by: newbie_01
1 Replies
6. Shell Programming and Scripting
hello all
I am writing a perl code and i wish to remove the special characters for text.
I wish to remove all extended ascii characters. If the list of special characters is huge, how can i do this using substitute command
s/specialcharacters/null/g
I really want to code like... (3 Replies)
Discussion started by: vasuarjula
3 Replies
7. Shell Programming and Scripting
Hi All,
I have a variable like
AVAIL="\
BACK:bkpstg:testdb3.iad.expertcity.com:backtest|\
#AUTH:authstg:testdb3.iad.expertcity.com:authiapd|\
TEST:authstg:testdb3.iad.expertcity.com:authiapd|\
"
What I want to do here is that If a find # before any entry, remove the entire string... (5 Replies)
Discussion started by: engineermayur
5 Replies
8. Shell Programming and Scripting
Hi,
In source data few of columns are having special charates(like *) due to this i am not able to display the data into flat file.it's displaying the some of junk data into the flat file.
source dataExample:
Address1="XDERFTG * HYJUYTG"
how to remove the special charates in a string (2 Replies)
Discussion started by: koti_rama
2 Replies
9. Shell Programming and Scripting
Hi,
I have string like this ="Lookup Procedure"
But i want the output like this Lookup Procedure
=," should be removed.
Please suggest me the solution.
Regards,
Madhuri (2 Replies)
Discussion started by: srimadhuri
2 Replies
10. Shell Programming and Scripting
Hi Gurus,
I have file which contains some unicode charachator like "ü". I want to replace it with some charactors. I searched in internet and got command sed "s/ü/-/g", but I don't know how to type ü in unix command line.
Please help me for this one.
Thanks in advance (7 Replies)
Discussion started by: ken6503
7 Replies
KCMP(2) Linux Programmer's Manual KCMP(2)
NAME
kcmp - compare two processes to determine if they share a kernel resource
SYNOPSIS
#include <linux/kcmp.h>
int kcmp(pid_t pid1, pid_t pid2, int type,
unsigned long idx1, unsigned long idx2);
Note: There is no glibc wrapper for this system call; see NOTES.
DESCRIPTION
The kcmp() system call can be used to check whether the two processes identified by pid1 and pid2 share a kernel resource such as virtual
memory, file descriptors, and so on.
The type argument specifies which resource is to be compared in the two processes. It has one of the following values:
KCMP_FILE
Check whether a file descriptor idx1 in the process pid1 refers to the same open file description (see open(2)) as file descriptor
idx2 in the process pid2.
KCMP_FILES
Check whether the process share the same set of open file descriptors. The arguments idx1 and idx2 are ignored.
KCMP_FS
Check whether the processes share the same file system information (i.e., file mode creation mask, working directory, and file sys-
tem root). The arguments idx1 and idx2 are ignored.
KCMP_IO
Check whether the processes share I/O context. The arguments idx1 and idx2 are ignored.
KCMP_SIGHAND
Check whether the processes share the same table of signal dispositions. The arguments idx1 and idx2 are ignored.
KCMP_SYSVSEM
Check whether the processes share the same list of System V semaphore undo operations. The arguments idx1 and idx2 are ignored.
KCMP_VM
Check whether the processes share the same address space. The arguments idx1 and idx2 are ignored.
Note the kcmp() is not protected against false positives which may have place if tasks are running. Which means one should stop tasks
being inspected with this syscall to obtain meaningful results.
RETURN VALUE
The return value of a successful call to kcmp() is simply the result of arithmetic comparison of kernel pointers (when the kernel compares
resources, it uses their memory addresses).
The easiest way to explain is to consider an example. Suppose that v1 and v2 are the addresses of appropriate resources, then the return
value is one of the following:
0 v1 is equal to v2; in other words, the two processes share the resource.
1 v1 is less than v2.
2 v1 is greater than v2.
3 v1 is not equal to v2, but ordering information is unavailable.
On error, -1 is returned, and errno is set appropriately.
kcmp () was designed to return values suitable for sorting. This is particularly handy if one needs to compare a large number of file
descriptors.
ERRORS
EBADF type is KCMP_FILE and fd1 or fd2 is not an open file descriptor.
EINVAL type is invalid.
EPERM Insufficient permission to inspect process resources. The CAP_SYS_PTRACE capability is required to inspect processes that you do
not own.
ESRCH Process pid1 or pid2 does not exist.
VERSIONS
The kcmp() system call first appeared in Linux 3.5.
CONFORMING TO
kcmp() is Linux specific and should not be used in programs intended to be portable.
NOTES
Glibc does not provide a wrapper for this system call; call it using syscall(2).
This system call is available only if the kernel was configured with CONFIG_CHECKPOINT_RESTORE. The main use of the system call is for the
checkpoint/restore in user space (CRIU) feature. The alternative to this system call would have been to expose suitable process informa-
tion via the proc(5) file system; this was deemed to be unsuitable for security reasons.
See clone(2) for some background information on the shared resources referred to on this page.
SEE ALSO
clone(2), unshare(2)
COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2013-01-27 KCMP(2)