The sed command "l" (a small L) will print out
all non-printable characters in escaped form.
Then run sed again with the escape sequence for
your non-printable character.
I am trying to write a script that kills old sessions, I've posted here over the past few days and the script is just about perfect except I want to be given the option to exclude specified PIDs from being killed. this is the entire script:
if
then
rm /tmp/idlepids
fi
if
then
rm... (2 Replies)
Greetings! I found this fourm via a google search on "sed expressions".
I have a file that contains notices and they are all the same length in lines. For example the file would contains 15 notices, each being 26 lines each. I need some way to eliminate notices that contain a "S" in a particular... (8 Replies)
Hello all,
How would I go to a particular line in a file and remove certain text from it and replace with something that I want it to be there.
like: file /etc/abc
now look for line HOME="/export/xyz" in /etc/abc
and then replace with HOME=/"export/xyz1"
thanks in advance guys. (1 Reply)
All,
So, I have an ldif file that contains about 6500 users worth of data. Some users have a block of text I'd like to remove, while some don't.
Example (block of text in question is the block starting with "authAuthority: ;Kerberosv5"):
User with text block:
# username, users,... (7 Replies)
Hi all...
I want to delete the entire text of the file and want to make it zero byte..
would you please tell me the command for it.
Thanks and regards
Vijay sahu (4 Replies)
Hello,
I got files full path in a text file like that
/main/k/kdelibs/kdelibs4c2a_3.5.10.dfsg.1-2ubuntu7_i386.deb
/main/k/kdelibs-experimental/libknotificationitem-dev_4.3.2-0ubuntu1_i386.deb
/main/k/kdemultimedia/dragonplayer_4.3.2-0ubuntu1_i386.deb... (13 Replies)
Need help whit a script where I have to input a name and then remove a line where that name is in a file
file ex:
001op;Name;Location;date
002op;Name;Location;date
and so on....
can anybody help me???
thanks (4 Replies)
Hello Friends,
I am stuck with the below problem.Any help will be appreciated.
I have a file which has say 100 lines.
On the second last line I have a line from which i want to remove certain characters..
e.g
CAST(CAST( A as varchar(50)) || ',' ||
CAST(CAST( B as varchar(50)) || ',' ||... (8 Replies)
Trying to use sed to, in-place, remove specific text from a file. Since there are / in the text I use | to escape that character. Thank you :).
sed -i -e 's|xxxx://www.xxx.com/xx/xx/xxx/.*/|' /home/cmccabe/list
sed: -e expression #1, char 51: unterminated `s' command (4 Replies)
Hello experts,
I have a text file with lot of curly brackets (both opening { & closing } ). I need to delete them alongwith the text between opening & closing brackets' pair.
For ex: Input:-
59. Rh1 Qe4 {(Qf5-e4 Qd8-g8+ Kg6-f5
Qg8-h7+ Kf5-e5 Qh7-e7+ Ke5-f5 Qe7-d7+ Qe4-e6 Qd7-h7+ Qe6-g6... (6 Replies)
Discussion started by: prvnrk
6 Replies
LEARN ABOUT DEBIAN
strcstr
STRCSTR(3pub) C Programmer's Manual STRCSTR(3pub)NAME
strcstr - convert memory block to printable C string notation
SYNOPSIS
#include <publib.h>
void strcstr(char *str, size_t max, const void *block, size_t n);
DESCRIPTION
strcstr converts the contents of an arbitrary memory block (which need not be a zero terminated string) into a printable notation using
normal C string literal syntax. This can be used for example to store potentially binary data in a file, or in debugging outputs.
All characters for which there is a simple shorthand escape sequence (', ", ?, , a, , f,
,
, , v) are stored using that nota-
tion. is stored as . All other non-printable characters are stored using a hexadecimal escape sequence. All other printable charac-
ters are stored as is.
The isprint(3) macro is used to determine whether a character is printable (i.e., whether it is printed as is, or using special notation).
Therefore, the output depends on the locale.
RETURN VALUE
strcstr returns nothing.
EXAMPLE
The following code dumps input to the standard output in a guaranteed (modulo locale bugs) printable format. It might be used for debug-
ging.
#include <stdio.h>
#include <publib.h>
int main(void) {
char line[512];
char cstr[512*(CHAR_BIT/4+1+2)+1]; /* +2 for x, +1 for ,
the rest to be able to
store the hex code for
512 chars. */
while (fgets(line, sizeof(line), stdin) != NULL) {
strcstr(cstr, sizeof(cstr), line, strlen(line));
printf("%s0, cstr);
}
return 0;
}
SEE ALSO publib(3), strins(3)AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual STRCSTR(3pub)