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
Solved

Unix General question

Posted on 1997-09-23
8
205 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
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

792 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