07-10-2001
getting rid of control characters
how can i get rid of the control characters , ex. ^M, ^G, in a file?
thanks...
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I man a command and save it in a file. ftp to pc. but when i displayed it. it has some repeat and funny characters. how can i get rid of it?
eg.
$ man ls > lsman
then use ftp transfer the file from unix to pc.
open file laman. it has some thing like
NNNNAAAAMMMMEEEE
repeat letters... (4 Replies)
Discussion started by: gusla
4 Replies
2. UNIX and Linux Applications
Hi Friends,
we have recently installed RHEL4.4 and when i give the commd
ls -l > tt it prints the file name with some special charactes like
^[[00m1 in the begining of the file name and at the end of the file name. I wanted to use the file names of removing it before taking
the backup and... (4 Replies)
Discussion started by: vakharia Mahesh
4 Replies
3. UNIX for Dummies Questions & Answers
Hi!
So i've got this shell script that asks questions and the user is required to input answers. The answers typed are bold.
sh-*.*$ sh filename dir
cat question
tput bold
read ans
tput sgr0
... and so on
tput sgr0
exit
So when the script ends i don't get the bold characters... (3 Replies)
Discussion started by: Kingzy
3 Replies
4. Shell Programming and Scripting
I have a database script that always produces the following output:
0
btw, the unwanted character looks like a square on a unix system. it doesn't look like the above quote.
how can I get rid of it and only keep the "0"?
---------- Post updated at 01:57 PM ---------- Previous update was... (2 Replies)
Discussion started by: SkySmart
2 Replies
5. Shell Programming and Scripting
Hi!
Could anyone so kindly help me a code to eliminate from a txt file, obtained by collecting and merge several web-page, every word (string) containing non alphabetical, numeric and punctuation character (i.e NON a-zA-Z0-9, underscore and punctuation mark)?
Thanks a lot for the help to... (5 Replies)
Discussion started by: mjomba
5 Replies
6. UNIX for Dummies Questions & Answers
When I use vi to see what's in the file I get this:
int add1(int x) {^M return x + 1;^M}
^Mint subtract1(int x) {^M return x - 1;^M}
^Mint double_it(int x) {^M return x * 2;^M}
^Mint halve_it(int x) {^Mreturn x / 2;^M}
^Mint main() {^M int myint;^M int result;^M ... (2 Replies)
Discussion started by: Nonito84
2 Replies
7. Shell Programming and Scripting
ok, so i have no clue why this script i wrote spits out these bizarre characters:
i cant even copy and paste those characters on here because it just doesn't show up properly.
my question is, using sed, how can i get rid of all characters that aren't normal?
echo "abnormal characters" |... (4 Replies)
Discussion started by: SkySmart
4 Replies
8. Shell Programming and Scripting
sed -e "s// /g" old.txt > new.txt
While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Discussion started by: ijustneeda
11 Replies
9. UNIX for Dummies Questions & Answers
i'm grepping for words in the /var/adm/messages (sun solaris).
but it looks like while my grepping finds the strings, when it outputs them out, the beginning of some lines are chopped off.
Jun 13 14:06:02 sky.net ufs: NOTICE: alloc: /prod: file system full
3 14:39:19 sky.net ufs: NOTICE:... (1 Reply)
Discussion started by: SkySmart
1 Replies
10. Shell Programming and Scripting
so i have strings such as this:
'postfix/local#2,5#|CRON.*12062.*root.*CMD#2,5#|roice.*NQN1#1,2#|toysprc#1,4#'
i need to get rid of the "#" and the numbers between them for each of the strings above. so the desired output should be:
... (1 Reply)
Discussion started by: SkySmart
1 Replies
LEARN ABOUT REDHAT
xdeletecontext
XSaveContext(3X11) XLIB FUNCTIONS XSaveContext(3X11)
NAME
XSaveContext, XFindContext, XDeleteContext, XUniqueContext - associative look-up routines
SYNTAX
int XSaveContext(display, rid, context, data)
Display *display;
XID rid;
XContext context;
XPointer data;
int XFindContext(display, rid, context, data_return)
Display *display;
XID rid;
XContext context;
XPointer *data_return;
int XDeleteContext(display, rid, context)
Display *display;
XID rid;
XContext context;
XContext XUniqueContext()
ARGUMENTS
context Specifies the context type to which the data belongs.
data Specifies the data to be associated with the window and type.
data_return
Returns the data.
display Specifies the connection to the X server.
rid Specifies the resource ID with which the data is associated.
DESCRIPTION
If an entry with the specified resource ID and type already exists, XSaveContext overrides it with the specified context. The XSaveContext
function returns a nonzero error code if an error has occurred and zero otherwise. Possible errors are XCNOMEM (out of memory).
Because it is a return value, the data is a pointer. The XFindContext function returns a nonzero error code if an error has occurred and
zero otherwise. Possible errors are XCNOENT (context-not-found).
The XDeleteContext function deletes the entry for the given resource ID and type from the data structure. This function returns the same
error codes that XFindContext returns if called with the same arguments. XDeleteContext does not free the data whose address was saved.
The XUniqueContext function creates a unique context type that may be used in subsequent calls to XSaveContext.
SEE ALSO
Xlib - C Language X Interface
X Version 11 Release 6.6 XSaveContext(3X11)