LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX
User Name
Password
Other *NIX This forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.

Notices


Reply
  Search this Thread
Old 03-26-2011, 02:52 PM   #1
juju
Member
 
Registered: Jan 2005
Location: California
Distribution: Slackware current 08/2020
Posts: 53

Rep: Reputation: 0
Assigning color in shell, with ls command & HP-UX?


Greetings,

I'm doing some work for a class on a remote server, which is running HP-UX. I'm connecting using the Penguinet SSH client.

The color of the of the text is white against a black background. I'm fine with this for the most part. I would like to be able to assign various colors to directories, executable files, links, etc., etc. This is done automatically on my personal Fedora installation.

It would seem, this particular version of Unix doesn't support dircolors, which would easily allow me to copy the .dir_colors file to my home directory and configure colors that way.

How does one go about doing this in HP-UX? I'm not talking about assigning a color to the prompt, but to the files themselves.

Many thanks,

Juju
 
Old 03-26-2011, 02:54 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
The colors are usually done via your shell configuration. What shell are you using in HP-UX?
 
Old 03-26-2011, 02:56 PM   #3
juju
Member
 
Registered: Jan 2005
Location: California
Distribution: Slackware current 08/2020
Posts: 53

Original Poster
Rep: Reputation: 0
I'm using the Penguinet client, which only allows you to change the colors for the foreground and the background.
 
Old 03-26-2011, 03:00 PM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Ok.... What shell is being used under HP-UX?

Edit - You can either do a "echo $SHELL" or run the following:
Code:
ps -p $$ | tail -1 | awk '{print $NF}'

Last edited by corp769; 03-26-2011 at 03:02 PM.
 
Old 03-26-2011, 03:02 PM   #5
juju
Member
 
Registered: Jan 2005
Location: California
Distribution: Slackware current 08/2020
Posts: 53

Original Poster
Rep: Reputation: 0
BASH
 
Old 03-26-2011, 03:06 PM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Ok, just making sure. You can set LS_COLORS like the following:
Code:
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
That is my current setup.

You can use export LS_COLORS="" to set it.

Last edited by corp769; 03-26-2011 at 03:08 PM.
 
Old 03-26-2011, 03:20 PM   #7
juju
Member
 
Registered: Jan 2005
Location: California
Distribution: Slackware current 08/2020
Posts: 53

Original Poster
Rep: Reputation: 0
I added this line to .bash_profile and exported it, but the font color is still white. I used the 'set' command and LS_COLORS was listed with the appropriate values.
 
Old 03-26-2011, 03:58 PM   #8
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Is there a way to fully disable the colors of Penguinet client?
 
Old 03-26-2011, 04:13 PM   #9
juju
Member
 
Registered: Jan 2005
Location: California
Distribution: Slackware current 08/2020
Posts: 53

Original Poster
Rep: Reputation: 0
I don't think so. I allows for two colors settings, foreground and background. I don't see any options for removing these settings. I'm fairly sure this is the problem. I've posted to their support site and I'll see what I get.
 
Old 03-26-2011, 04:51 PM   #10
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Yeah, definitely sounds like it.
 
Old 03-28-2011, 12:06 PM   #11
juju
Member
 
Registered: Jan 2005
Location: California
Distribution: Slackware current 08/2020
Posts: 53

Original Poster
Rep: Reputation: 0
Just out of curiosity, what type of ssh client do you use regularly?
 
Old 03-28-2011, 12:41 PM   #12
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
I use a standard terminal
 
Old 03-28-2011, 12:47 PM   #13
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Once you set LSCOLORS... you have to use:

Code:
ls --color=auto
easily helped by

Code:
alias ls='ls --color=auto'
If I'm stuck on a windows machine, I will use PuTTY

Last edited by szboardstretcher; 03-28-2011 at 12:49 PM.
 
Old 03-28-2011, 01:27 PM   #14
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Ahh, thanks for that. I forgot I have ls aliased....
 
Old 03-28-2011, 01:54 PM   #15
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Yerp, no problem.

Many a horrible day has been had by forgetting 'bout them aliases.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Problem in assigning value to a variable in shell script. mshforever Linux - Newbie 8 11-30-2010 07:05 AM
Help with variable assigning in shell scripts fultron Linux - Newbie 2 02-16-2007 04:32 PM
assigning timestamp of one file to another using touch command Fond_of_Opensource Linux - Newbie 2 11-07-2006 11:17 PM
Assigning the output of one command to a variable (shell) guru_stew Programming 5 08-03-2003 06:12 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX

All times are GMT -5. The time now is 10:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration