10-28-2015
It's nothing to do with C.
The -e, in some very specific versions of the bourne shell, means "enable escape sequences", including octal ones, of the form backslash-zero-digit-digit[-digit]. In most other versions of the Bourne shell, the -e and the backslashes and everything will be dumped literally. printf, though, does support these sequences almost everywhere.
The [91m bit has nothing to do with C or BASH. It just prints a literal [, 9, 1, m. But a terminal supporting ANSI escape sequences will take octal 33, followed by [, 9, 1, m, to mean "change color to bright red".
The 39m means 'switch back to grey', which is a little wrong, as the appropriate thing to do is a reset to default, not what you assume the default to be.
Last edited by Corona688; 10-28-2015 at 02:19 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can somebody give me the link to get the source code of BASH? (1 Reply)
Discussion started by: bhargava
1 Replies
2. Shell Programming and Scripting
Hi,
I am trying to develop a bash script that contains an xml code. I want to put the xml code inside the bash script. Is there a way to make that happen?!
My goal is to create a script that can allow the user to enter some parameters which can be passed by the script to the xml code :o .
... (2 Replies)
Discussion started by: the wonderer
2 Replies
3. UNIX for Dummies Questions & Answers
Dear all,
Is there any open source tool for stripping the comments to bash script without affecting the code part?
Please give me any reference to it..
Thanks in Advance... (2 Replies)
Discussion started by: Nila
2 Replies
4. Shell Programming and Scripting
I am newbie to UNIX. I came across this exercise in one the books.Can anyone help me with this question??????
Write a short Bash script that, given the name of a file as an argument,
reads the file name and creates a new file containing only lines which consist
of one word. Here is an example... (4 Replies)
Discussion started by: krthknaidu
4 Replies
5. Shell Programming and Scripting
I want to let sleep 3 in the background and echo $i
pkglists="a b c d e f g"
f()
{
local i
set -- $pkglists
&& ((i +=2)) && sleep 3 &;echo $i
}
f (3 Replies)
Discussion started by: yanglei_fage
3 Replies
6. UNIX for Dummies Questions & Answers
I am not able to understand below line in unix bash shell.Could anyone explain what it will do
result="${path1}/*${var1}*${var2}*wssreligibleitem*.csv"
path1 is defined and it is a directory path
var1 is defined and it holds string value like abc
var2 is defined and it holds string value like... (6 Replies)
Discussion started by: vamsi.valiveti
6 Replies
7. Shell Programming and Scripting
Why doesn't the code below run? Am I missing something? Thank you :).
syntax() {
printf "\n\n"
printf "Enter HGVS description of variant(s): "; IFS="," read -a hgvs
&& printf "\n Nothijng entered. Leaving match function." && sleep 2 && return
for ((i=0;... (5 Replies)
Discussion started by: cmccabe
5 Replies
8. Shell Programming and Scripting
I have the below bash which runs great. Before I make a change I wanted to check with experts (as I am not one). After the perl code completes, I am going to display "annotation complete" then go into the remove function .
annovar() {
# combine id and position files
cd... (2 Replies)
Discussion started by: cmccabe
2 Replies
9. Shell Programming and Scripting
In this post at 302451613-post2.html the link to the code comes up not found. The thread is closed, so I was unable to ask on the thread itself and I do not have enough posts yet to send a private message (or write out a proper html link). Does the author (jim mcanamara) have an updated link?
... (2 Replies)
Discussion started by: matthewpersico
2 Replies
10. Shell Programming and Scripting
Hi All, I am trying a script out that will startup on one of my servers. i wanted to check for RC 0 and if it didnt check out, exit.
Typo- This is BASH (Redhat)
This isnt working, and this is the best way to do error checking I feel. Heres my erorr
./start: line 25: syntax error near... (2 Replies)
Discussion started by: jeffs42885
2 Replies