Escape Sequences

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Escape Sequences
# 1  
Old 11-17-2013
Escape Sequences

Hi Gurus,

Escape sequences \n, \t, \b, \t, \033(1m are not working.

I just practiced these escape sequences. It worked first. Later its not working.

Also the command - echo inside the script editor shows as shaded by a color. Before that echo inside the script editor wont show like this. I don't know what changes happened internally. Please help me on this.

# 2  
Old 11-17-2013
printf "<your escape sequence>"

As you may have an echo command that can't do escape sequences much like /bin/echo
on this OSX machine of mine...
printf "\033[1;34;45m test \033[0m"

OSX 10.7.5, default bash terminal...


Change \x1B to \033 just in case of csh...

Last edited by wisecracker; 11-17-2013 at 10:12 AM.. Reason: See above...
# 3  
Old 11-17-2013
Is there a way to reset the shell to a previous date-time

Am using BASH shell
# 4  
Old 11-17-2013
Perhaps with your experimentation you have inadvertantly disabled your internal bash
echo command and are relying on the external one which is limited but not insurmountable...

enable echo

From your terminal...
This is the HELP page for it from an OSX 10.7.5, default bash terminal:-
Last login: Sun Nov 17 15:47:03 on ttys000
AMIGA:barrywalker~> man enable
No manual entry for enable
AMIGA:barrywalker~> help enable
enable: enable [-pnds] [-a] [-f filename] [name ...]
    Enable and disable builtin shell commands.  This allows
    you to use a disk command which has the same name as a shell
    builtin without specifying a full pathname.  If -n is used, the
    NAMEs become disabled; otherwise NAMEs are enabled.  For example,
    to use the `test' found in $PATH instead of the shell builtin
    version, type `enable -n test'.  On systems supporting dynamic
    loading, the -f option may be used to load new builtins from the
    shared object FILENAME.  The -d option will delete a builtin
    previously loaded with -f.  If no non-option names are given, or
    the -p option is supplied, a list of builtins is printed.  The
    -a option means to print every builtin with an indication of whether
    or not it is enabled.  The -s option restricts the output to the POSIX.2
    `special' builtins.  The -n option displays a list of all disabled builtins.
AMIGA:barrywalker~> _

# 5  
Old 11-17-2013
man reset.
man console_codes.

tryprintf "\x1Bc"
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove escape sequences from a text file?

Hello friends, Could anyone please advise on how to remove escape sequences from a text file? $ file input.txt input.txt: ASCII English text, with escape sequences I'm able to see those escape characters when opened in vi editor like shown below: ^ but not when I run more... (6 Replies)
Discussion started by: magnus29
6 Replies

2. Shell Programming and Scripting

Extraction of sequences from files

hey!!! I have 2 files file1 is as ids.txt and is >gi|546473186|gb|AWWX01630222.1| >gi|546473233|gb|AWWX01630175.1| >gi|546473323|gb|AWWX01630097.1| >gi|546474044|gb|AWWX01629456.1| >gi|546474165|gb|AWWX01629352.1| file2 is sequences.fasta and is like >gi|546473233|gb|AWWX01630175.1|... (9 Replies)
Discussion started by: harpreetmanku04
9 Replies

3. Shell Programming and Scripting

Auto escape script to escape special chars in script args

This is a bit off the wall, but I often need to run scripts where there are argument values that contain special characters. For example, $ ./process.exe -t M -N -o temp.mol.s -i ../molfiles/N,N\',N\'\'-trimethylbis\(hexamethylene\)triamine.mol && temp.mol.s temp.s It... (1 Reply)
Discussion started by: LMHmedchem
1 Replies

4. Shell Programming and Scripting

Mail utility not displaying escape sequences

Hello! I created a file that displays text underlined. However when I pass the file into the mail utility it doesnt display the underline. Here is the code: echo "\n\033 cat test_underline.txt mail -s "testing of underline" <email_address> < test_underline.txt Any ideas?... (8 Replies)
Discussion started by: DPERTS
8 Replies

5. Shell Programming and Scripting

trimming sequences

My file looks like this: But I would like to 'trim' all sequences to the same lenght 32 characters, keeping intact all the identifier (>GHXCZCC01AJ8CJ) Would it be possible to use awk to perform this task? (2 Replies)
Discussion started by: Xterra
2 Replies

6. UNIX for Dummies Questions & Answers

How to input escape sequences in Linux tty?

More details: Unicode, Framebuffer. I tried to press Esc and then what should follow, letters or brackets, but seems not to work. Probably i do something wrong. If somebody is familiar with escape sequences in the console, how do you do that? Thanks in advance. (4 Replies)
Discussion started by: Action
4 Replies

7. Programming

Trigraph sequences

Hi, i have read trigraph sequence in The C99 Draft (N869, 18 January, 1999) printf("Eh???/n"); will produce printf("Eh?\n"); what does that mean? i tried that but i am getting the same output i.e Eh???/n. what actually these tri graph characters are? any idea why ,when and... (1 Reply)
Discussion started by: MrUser
1 Replies

8. UNIX for Dummies Questions & Answers

Escape Sequences appearing in scripts

I hope this question isn't too vague... i recently switched from RedHat to Solaris 10, and found that the parts of a script that copy files between directories no longer work because escape sequences are appearing at the start and end of the filenames being read #!/usr/bin/bash cd... (1 Reply)
Discussion started by: jwm-wm
1 Replies

9. Solaris

Available escape sequences

:) Hi, Can any one help me to find available escape sequences in UNIX shell programming? ( Like \n, \c etc,. in C or C++) Iam generating one report using one of the script, in that it is very much essential. Regards, LOVE (6 Replies)
Discussion started by: Love
6 Replies
Login or Register to Ask a Question