On Wed, Aug 04, 2004 at 09:19:20PM +0530, H S Rai wrote: > > [EMAIL PROTECTED] is my prompt. I substituted long prompt with small one to reduce > size of email ;-) > > What I found is that "cat scriptfile" display properly,
This is the normal behaviour of cat command. cat would hide all ^M and other control characters. To have them revealed, try: $ cat -vet scriptfile The output of this would be similar to what you see with less or view (with all embedded control codes revealed). To have a file clean of all ^M chars you may use tr, viz: $ tr -d '\015' < scriptfile > newfile.txt If you want most control chars removed (inclusive of ^M), try: $ col -b < scriptfile > newfile.txt > but in editor (vi, joe) I show all escape sequences and repetition. > The sample file may be found at: > > http://gndec.ac.in/~hsrai/tmp/script.txt > Just had a look. This is the normal output of script. Why the line "[EMAIL PROTECTED] hsrai]$ ./a.out" is being repeated is because there seem to be other control attributes in this line, (? prompt in colour). A 'col -b' conversion sets them right ! By default script puts a ^M at the end of every line like a DOS file. If you want to remove these ^M markers under vim then try: :%s/^M//g [Note: ^M is Ctrl-v followed by Ctrl-m] This would not remove other ctrl chars, other than ^M. HTH Bish -- : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Console gibberish (#4) LOST #133 To clear console of gibberish (eg. after cat of a tar.gz file) go to another virtual console and type in: echo -e '\017' > /dev/tty1 # if tty1 was the affected console ####[usmbish (at) users.sourceforge.net]###################### : ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ linux-india-help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/linux-india-help
