Ubuntu :: Bash Color In A Script Not Working?

Mar 6, 2011

This works (meaning it changes color) from CLI...echo -e 'e[1;36m' testCyanBut if I put that same exact line in a script, the result is not colored, and it displays the actual command on screen like this...-e 'e[1;36m' testCyanThe script is obviously executing. Why isn't it interpreting the backslash command in the script?

View 2 Replies


ADVERTISEMENT

Ubuntu :: Bash File Color Decoding?

Apr 15, 2011

Is there a place in my 10.04 OS that tells me the meaning of the colors of files? I have a folder that I moved to my home directory when i upgraded from 9.10 to 10.04. In that folder was a .tar.gz file that was green - I then deleted that file and ran another compression command - same files, same everything, but when I ran it this time, it is now red. Any ideas. I'd like to know what the color indication is on any given file.

View 2 Replies View Related

Red Hat :: Changing Bash Color Prompt?

Mar 24, 2010

I was attempting to change the bash shell color prompt on my RHEL / CentOS 5 server. When I login as my user account on my server I can see my 'PS1':

Code:
[carlos@srv1 ~]$ echo $PS1
[u@h W]$

I want to change my PS1 to:

PS1='[e[1;32m][u@h W]$[e[0m] '

When I look in ~/.bashrc, I don't see my 'PS1' line so I am confused and wondering how I do this on RHEL / CentOS systems.

View 2 Replies View Related

Fedora :: Color Prompts Screws Bash?

Aug 7, 2010

I got a good one!I colorized my prompt as follow; Green for normal user, Red for root:

Root .bashrc:
PS1=e[0;31m[ ][u@h:w][!]\$ e[m"
User .bashrc:
PS1="e[0;37m[ ][u@h:w][!]\$ e[m"
Which gives:

[Code]...

View 7 Replies View Related

Programming :: Get Pixel Color From Screen In Bash Script?

Nov 25, 2010

I would like to get the pixel color from screen at (320,240) and if the color = 0xFFFFFFFF , i would like to execute a command.

View 3 Replies View Related

Red Hat / Fedora :: Change Input/Output Color In Bash?

Jun 5, 2009

When in the interactive envirment, my Input and Output are all mess-up. So i want to color the Input and Output with two different colors.. so i can figure them out..

View 1 Replies View Related

Programming :: Changing Color Of Output From Bash Script?

Apr 22, 2010

I am writing a bash script that utilizes the output of another script (which I will refer to as script#2.) Script#2 is not owned by me, I cannot modify it. All of the output from script#2 is blue, which makes it difficult for me to read.

I would like to have the output of it changed to grey. Is there a way I can do that in my script? A command I can pipe the output to?

Edit: One other question related to this. I put a trap function in my script that works well. Script#2 essentially runs a tail -f. When I ctrl+c to stop it, it stops script#2 and never calls the trap in my script. Is there any way I can work around that?

View 3 Replies View Related

Programming :: Easier Way To Color Text In Perl Like BASH?

Apr 8, 2010

I've been trying to figure out a way to more easily color text in Perl like I do on Bash on a Linux box. In bash, what I'll do is set color variables up to equal the escape sequence, then echo out with escape seqeunces to print it exactly how I want it. Typically I'll want a character or a word in a different color, not the whole line. For example

echo -n -e "My face is turning ${RED}red${UNCOLOR} like a lobster." In Perl with the term::ANSIColor module, it seems to just do a line. Am I being dense? Is there a way that I can do it like I do it in BASH that's fairly easy to read after the fact?

View 11 Replies View Related

Debian Configuration :: Change Prompt Color In Bash Shell?

Jan 13, 2010

I am getting more and more comfortable working with the shell, thus I would like to change its prompt color to my liking, as it will be easier for me to distinguish commands vs. outputs.

I've read a couple of instructions of how to change the .bashrc file and am familiar with what the codes in PS1 mean. Except, this file can be intimidating to newbie eyes.

Where exactly on the file is it that I need to make the change?

Here is what I am trying to do. I would like my prompt to like exactly like the prompt I use in Backtrack - which consist in two different colors, one for the host and another for the pwd. Here is what the Backtrack .bashrc file looks like:

# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells.
# Set the values for some environment variables:
export MINICOM="-c on"
export MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man:/usr/local/share/man:/usr/bin/man:/usr/share/man
export HOSTNAME="`cat /etc/HOSTNAME`"

[Code]....

I also read that in order to have the same results when I log in as root, I will have to copy the modified .bashrc file into /root

View 8 Replies View Related

Programming :: Bash : Searching For Info And Changing The Color Of Keywords In The Results?

May 5, 2011

(bare with me as I am sort of new with scripting) I am trying to figure out how to run a script that does a basic chkconfig and to get only those services that are running, but changing the color of "on" to red in my output file. Here is what I am working with so far:

Quote:

#/bin/bash
RED=$(tput setaf 1)
BLK=$(tput setaf 0)

[code]....

*I had to substitute a "-" and <colon_symbol> for ":" in front of the on's, because the forum thought they were smiley faces (i.e. n) how to make the "on" to be red while the rest of everything remains in black text. I have been trying to read up on sed and awk, but it is still pretty much a mystery to me right now. There will be other things in the output file that I wouldn't want a rogue "on" to be in red, so just the instances of "on" in that one chkconfig return.

View 4 Replies View Related

General :: Running Bash But Common Bash Commands Not Working?

Jul 17, 2010

below are the details of my system. I have bash as my current shell, some really common commands aren't working.

Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])

Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$

[Code]....

View 13 Replies View Related

Ubuntu :: Can GNOME Color Be Used To Alter Ambiance Theme Color?

Jan 12, 2011

Can GNOME Color be used to alter this change directory color in Ambiance theme? I'd rather have white.

View 4 Replies View Related

General :: Desktop Environment Color Settings / Do They Affect Web Browser Color?

Jun 14, 2011

Kernel 2.6.21.5, Slackware 12.0
KDE 3.5.7
(Mozilla) Firefox 2.0.0.4

Do color settings in the desktop environment affect color in the web browser? Thanks.

View 2 Replies View Related

Software :: Screen App / Retain BG / Color Background Color Gets Lost

Jul 6, 2009

I am using the screen app, and have set bce to on, and issued the following commands to set my background and foreground color: tput setab 4; clear; tput setaf 7; clear;

This temporarily sets everything properly on my screen. However, when I issue any commands that change or set their own background color (for example, when I issue an "ls" command with colorized output), the background color gets lost for any new output and I have to reissue the commands listed above in order to retrieve my background color.Ideally I'd like to keep my background color when issuing these commands, as it serves as a good way to remind me of what environment I am currently issuing commands in.

View 1 Replies View Related

Programming :: Favorite 256-color Vim Color Scheme

Feb 25, 2011

What is your favorite 256-color color scheme for vim?

View 6 Replies View Related

Ubuntu :: HP Color Printer Not Printing Black As Black, Uses Tri-color Instead?

Feb 2, 2010

I have an HP color laser printer and I am looking for a way to print black as black instead of using tri-color. For example If I print a document that has colored text then any black text is printed using the color cartridges rather then using black. I have been surviving by using windows XP in virtualbox but I'm hoping someone can help me with this. I've looked all over then net for a solution but I've found nothing. I remember having similar problems like this with older Macs because of postscript printing and I'm thinking this is the same problem but I don't know how to fix it. I've searched the forums as well but no joy.

View 3 Replies View Related

Ubuntu :: Bash Script Not Working?

Nov 9, 2010

The first step of my project is to figure out what music files are in my Music folder.

Here is the beginning of my script. If I put the script in the Music folder, it works and generates my 'catalog' file. However, if I put the script in a different directory (say, my Scripts directory), I don't get any errors, but I also get no 'catalog' file.

Code:

#!/bin/bash
##find /usr/src -not ( -name "*,v" -o -name ".*,v" )
find /home/XX/Music -type f -print -name '*.mp3' > catalog

why do I not get my 'catalog' file if I place the script in a different directory?

View 3 Replies View Related

Ubuntu :: Variables In Bash Alises Not Working With 11.04

Jul 26, 2011

I am trying to use the following bash alias:

I've been able to get this working under mac and solaris.

I've also tried not escaping the vars.

Anyone know if this is doable with ubuntu's bash shell? (or any meaningful workaround other than writing a script for this?)

View 2 Replies View Related

Ubuntu :: Latest Kernel Update Bash Not Working?

Nov 24, 2010

I am running Maverick via Wubi. I just completed a Kernel upgrade and when I restart into Ubuntu it just goes to a Bash prompt. I am not sure exactly what version I updated to so I haven't logged a bug report yet.

View 1 Replies View Related

General :: Writing In Bash While It Is Working?

May 6, 2011

When you are performing time consuming operations in bash like installing new software, is it possible to write text that will appear at the prompt when the operation has finished.

E.g

Imagine running:

apt-get install eclipse-platform

Then it will use quite a while to finish while you see the installation log, meanwhile I want to create new folders (workspaces) which Eclipse later will use.

Is this possible without opening a new terminal (or tab)?

View 5 Replies View Related

General :: Scp Is Not Working With Restrict Bash?

Apr 21, 2011

I just wondering if scp working with restrict bash ? It seems like my scp just stuck there while login.

If i use ftp i get 530 login failed..

View 1 Replies View Related

General :: Bash For Loop Not Working?

Apr 21, 2010

I have bash 4.0. I used the following for loop example, but all it outputs is "{1..10} instead of the actual numbers one through ten. why?

Code:
for a in {1..10}
do
echo -n "$a "
done

View 5 Replies View Related

Ubuntu :: Bash Commands' Auto-complete Not Working For Some Apps?

Jan 15, 2010

I've got an annoying problem that 'man' and some other commands do not auto-complete (via TAB). e.g. typing: man rsyn (TAB, TAB, TAB, etc) will not auto-complete to 'man rsync' however, if i 'sudo -s' & then try the above, 'man' auto-completes everytime. (Directories always auto-complete successfully) My ~/.bashrc contains:

Code:

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion

[code]....

View 8 Replies View Related

Ubuntu :: Chroot Not Working: Cannot Run Command `/bin/bash': No Such File Or Directory

Mar 20, 2010

I'm trying to change the root directory to /tmp/somedir using chroot, but even using sudo or su-ing to root I get the message:

Code:

cannot run command `/bin/bash': No such file or directory

I tried copying /bin/bash to /tmp/somedir/, but the same error occurs. What's wrong with my chroot?

View 7 Replies View Related

General :: Error Propagation Not Working In Bash

Mar 14, 2011

when ever some error happens in the functions, they are not propagated and err_out function is not called.I tried #!/bin/bash -E too; that way when there is an error the script exits but what I need is error to be propagated properly to the handler.

View 1 Replies View Related

Software :: Bash Hostname Completion Not Working?

Nov 25, 2009

According to the Bash man pages, Quote: HOSTFILE Contains the name of a file in the same format as /etc/hosts that should be read when the shell needs to complete a hostname. The list of possible hostname completions may be changed while the shell is running; the next time hostname completion is attempted after the value is changed, bash adds the contents of the new file to the existing list. If HOSTFILE is set, but has no value, bash attempts to read /etc/hosts to obtain the list of possible hostname completions. When HOSTFILE is unset, the hostname list is cleared.

Here's the line in my .bashrc where HOSTFILE is set:

Code:

export HOSTFILE="~/.hosts"

I opened a new bash session, created ~/.hosts, filled it with the names of servers that I wanted to expand using tab completion. then typed

Code:

ssh p<tab><tab>

expecting to get a lists of all of the hosts in ~/.hosts starting with 'p'. Bash simply beeped at me twice.

I tried

Code:

$ shopt hostcomplete
hostcomplete on

Code:

ssh bchittenden@p<tab><tab>

same results.

[code].....

View 2 Replies View Related

Programming :: BASH - If Variable -eq String Not Working ?

Jan 24, 2010

Here is the code:

Code:

How ever when I run this script I get the following error

Quote:

I just don't get it, I have racked my brain trying to figure out every combination of how I should write this if statement and I can't get it to work.

View 2 Replies View Related

Programming :: History -c Is Not Working In Bash Script?

Mar 26, 2010

i wrote a script to run over a macintosh system

Quote:

#!/bin/bash
history -c
clear

but the script not doing what i am trying to achieve.

View 1 Replies View Related

Programming :: Working With User Input In Bash

Jun 2, 2009

I've been using python/bash to help myself automate things for a long time, however I am curious. One reason I use python more is because I don't quite know how to work with user input in Bash, such as getting it to ask for input and wait, and then placing that user input into a command.

Here's an example of a script I use from time to time for converting OGG video files into AVI.

How could I write this same script in Bash? Keep in mind I am mostly self taught, so I am by no means an expert programmer.

Code:

View 3 Replies View Related

Debian :: Login Via SSH - Bash Autocomplete Stopped Working

Feb 3, 2011

For some reason my bash autocomplete stopped working. I get the error when I try to cd into a directory, pressing <tab> for autocomplete:
cd A-sh: <( compgen -d -- 'A' ): No such file or directory
Autocomplete works for the root user and for the other user on the machine, just not logged in as this user. The .bashrc file looks fine to me, and I didn't make any changes to it to even cause the bash autocomplete to stop working (as far as I know).

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
What else could cause autcomplete to stop working? I log in via ssh, btw.

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved