Solved

Unix General question

Posted on 1997-09-23
8
210 Views
Last Modified: 2013-12-27
As I know , by using escape sequence control, we can
creat special effect Assic art, like moving text. But
here in my university sun solaris terminal, I don't how
to edit a file contains control sequence. Using pico, it
doesn't repond when I press ESC key. What should I do?
Thanks.

0
Comment
Question by:xz02
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 1

Expert Comment

by:szetoa
ID: 2007092
I may have a solution if you know how to use 'vi'.  First you need to 'insert' an ESC character in a file.  Then you just keep copying this character whenever you need to create another control sequence.  At your UNIX prompt, try this:

echo <ESC> > afile

NOTE:  <ESC> is the escape key, the second '>' is the output redirection, and afile is any file name you want.  This command inserts a single character in the 'afile' and then you can use 'vi' to add other characters after the <ESC>.

p.s.  I believe the <ESC> character looks like ^[, but actually it is only one character.  You can also use 'yank' and 'paste' commands in 'vi' to duplicate this character.
0
 

Author Comment

by:xz02
ID: 2007093
Thank you,szetoa,your answer is perfect.
How do give you points?
0
 
LVL 1

Expert Comment

by:szetoa
ID: 2007094
xz02,

Glad it helps.  But this is my first time to response to any question and I have no idea how to get points.  Keep the points. You may need them for other questions.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:gwalters
ID: 2007095
To get points, you have to "answer", not "comment".
0
 
LVL 4

Expert Comment

by:jos010697
ID: 2007096
There's no need to copy those escape characters. Vi has the
^v (control-V) prefix. If you want to insert an escape somewhere
in your text, simply press i ^v <escape>, i.e. 'i' for insert,
^v for 'literal character' and <escape> for escape ...

kind regards,

Jos aka jos@and.nl
0
 
LVL 1

Expert Comment

by:szetoa
ID: 2007097
xz02,

Give the points to 'jos'.  S/he got a better answer.
0
 
LVL 4

Expert Comment

by:jos010697
ID: 2007098
Who cares about those points (points don't buy you anything ;-)
as long as it helps out 'xz02', everything is fine, isn't it?

kind regards,

Jos aka jos@and.nl

ps. BTW, I'm male ;-)

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 40 total points
ID: 2007099
! echo <ESC> > afile
! NOTE: <ESC> is the escape key, the second '>' is the output redirection, and

szetoa, this doing at a "UNIX prompt" (what do you mean by that?)
will do nothing, in most cases, means you get a file just containing a \n (newline). Ups, you also may hear a beep.
If this will work depends on a lot of thing:
  1. the flaviour of UNIX
  2. the shell (sh, csh, bash, zsh, ash, etc. etc.)
  3. $PATH in this shell, and therefore if it is the shell's builtin echo or an external command found via $PATH

As jos said, you may get these chars by using vi's ^v facility.
But take care using vi with files which have non-visibale chars, use the  `set list'  command in vi to see them all (man vi, you know .. ;-).

And for those who care about the points, I marked it as answer so that it might get off the list of questions :-))
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question