LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX
User Name
Password
Other *NIX This forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.

Notices


Reply
  Search this Thread
Old 02-15-2023, 10:06 AM   #1
amikoyan
Member
 
Registered: Mar 2021
Distribution: Slackware64 -current
Posts: 316

Rep: Reputation: 169Reputation: 169
ed text editor not saving/printing # character


I am using v7 Unix in a simh pdp11 emulator.
The only text editor available is ed, I think.
I am trying to write
Code:
#include <stdio.h>
in ed. It enters ok, but the # will not appear in the saved file. Also entering #'s appears to delete a similar number of characters before the #'s, if you see what I mean:
I entered this in ed and wq'd to write and quit:
Code:
Hello##### is this here?
I have ### added some hash tags
This is what is saved:
Code:
 cat test.txt
 is this here?
I ha added some hash tags.
I don't seem to need #include <stdio.h> as I it seems I can compile without it in v7, but it would be nice to know why #'s seem to cause problems.

Last edited by amikoyan; 02-15-2023 at 10:08 AM.
 
Old 02-15-2023, 10:22 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
# seems to mapped to backspace, so you need to remap it. stty can be used to do that.
 
1 members found this post helpful.
Old 02-15-2023, 12:34 PM   #3
amikoyan
Member
 
Registered: Mar 2021
Distribution: Slackware64 -current
Posts: 316

Original Poster
Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by pan64 View Post
# seems to mapped to backspace, so you need to remap it. stty can be used to do that.
I have remapped it to ctrl H

Code:
stty erase ^H
Code:
 $ stty
speed 300 baud
erase = '^H'; kill = '@'
even odd -nl echo -tabs
Which a little bit of googling leads me to believe is traditional?

Thank you pan64.

Last edited by amikoyan; 02-15-2023 at 12:39 PM. Reason: so I have stty code snippet for future reference
 
Old 02-15-2023, 02:53 PM   #4
amikoyan
Member
 
Registered: Mar 2021
Distribution: Slackware64 -current
Posts: 316

Original Poster
Rep: Reputation: 169Reputation: 169
This is from
Code:
              Setting Up Unix - Seventh Edition


                      Charles B. Haley
                     Dennis M. Ritchie

                     Bell Laboratories
               Murray Hill, New Jersey 07974
A few paragraphs down the document it says:

Code:
 If you should make a mistake while typing, the  charac-
ter  '#' erases the last character typed up to the beginning
of the line, and the character '@' erases  the  entire  line
typed.   Some  consoles  cannot  print  lower  case letters,
adjust the instructions accordingly.


https://gunkies.org/wiki/Setting_Up_...eventh_Edition

Last edited by amikoyan; 02-15-2023 at 03:05 PM.
 
1 members found this post helpful.
Old 02-16-2023, 12:47 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
Quote:
Originally Posted by amikoyan View Post

Which a little bit of googling leads me to believe is traditional?

Thank you pan64.
You are welcome.

I don't actually remember where it came from, but I remembered something....
You know, it was over 30 years ago.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Micro Text Editor: Lightweight and Intuitive Terminal-Based Editor LXer Syndicated Linux News 0 09-21-2021 09:46 AM
[SOLVED] return text from geany or other editor to IDE after saving and closing the editor mtdew3q Programming 4 05-15-2013 10:40 PM
Bash scripting: parsing a text file character-by-character Completely Clueless Programming 13 08-12-2009 09:07 AM
How to store text(strings) in a 2D character array reading from a text file(C++) bewidankit Programming 3 02-14-2008 07:08 AM
saving and not saving sessions on desktop ergo_sum Linux - Newbie 2 09-26-2003 07:27 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX

All times are GMT -5. The time now is 01:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration