Solved

Unix General question

Posted on 1997-09-23
8
202 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…
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.

832 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