Sponsored Content
Top Forums Shell Programming and Scripting "BOLD" printing a variable in PS1 command Post 302176151 by jaduks on Monday 17th of March 2008 01:50:50 PM
Old 03-17-2008
Code:
export PS1='\u@\033[1m`hostname`\033[0m:\w> '
or
export PS1='\u@\033[1m\h\033[0m:\w> '

//Jadu
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get Find command work with a variable passing "*" value?

Hi guy, I have a problem to pass a variable containing '*' value to FIND command. below is the script. It doesn't work by submit below command: rmf.sh name '*.txt' or rmf.sh name *.txt I've tried either optn="-name '$2'" or optn="-name $2"., and there is no luck. ### (script... (5 Replies)
Discussion started by: unxuser
5 Replies

2. Shell Programming and Scripting

How can I use a pipe operator in a variable: OPTION="| command"?

I have a string of commands I am piping some data through and I want to allow command line switches to select which commands are used. I want to do something like this: OPTION="| command3" command1 -a -b c.txt | command2 -d -e $OPTION >result.txt I want to do it that way because OPTION may be... (1 Reply)
Discussion started by: KenJackson
1 Replies

3. Shell Programming and Scripting

Custom PS1 "anamoly"

Hello: Any bash PS1 gurus in the house? I have a custom 2-line prompt and it displays fine, but there is an occasional anomaly. The backspace key sometimes takes out the 2nd line. Here's the relevant ~/.bashrc code: MKF='This is my Kung-Fu' DOS='C:${PWD//\//\\\}>' PS1="\$MKF\n\\" ... (0 Replies)
Discussion started by: Habitual
0 Replies

4. Shell Programming and Scripting

Storing output of "time" command to a variable

Hi all, I am new to Linux/shell scripting having moderate knowledge. In my script, I need to get execution time of a command (say 'ls') in mili seconds level. For this i tried using "time" command to retrieve the total execution time in milli seconds. But, the problem is that, how to save... (9 Replies)
Discussion started by: happening_linux
9 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Variable interpolation in "print" of awk command

Hi, I have a snippet like below. Based on variable i, i wish to print 1,2,3,4,5th columns to Sample files. For each loop, one column from contetn and results will be pused to sample files. But i have a problem here i=1 while ; do `awk -F"\t" '{print $($i)}' $content > Sample_${i}_original`;... (4 Replies)
Discussion started by: forums123456
4 Replies

7. Shell Programming and Scripting

Cat Command on File not printing "Blank" Lines?

Hello All, I have a bash script and in it at some point I call an Expect Script that does some stuff and saves its output in a ".txt" file. Example "/path/to/my/file/Expect_Output.txt" file: notice the 2nd line is empty in the file... Data for Host-1 (192.168.1.110) Checking the... (2 Replies)
Discussion started by: mrm5102
2 Replies

8. Solaris

Netra X1 LOM: Unable to change any variable via the "set" command

I'm posting here as it didn't seem quite right in the hardware section (as it's LOM commands). My apologies if I have that wrong though :) I've finally gotten round to configuring the LOM on my Netra X1, but I can't get it to change the hostname via the "set" command: lom>show hostname... (2 Replies)
Discussion started by: Smiling Dragon
2 Replies

9. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

10. Shell Programming and Scripting

awk variable into shell command "date -d": possible...?

Hello, there! I am trying to pass an awk variable into a shell command in order to collect the result into an awk variable; in Bash it does work, as in: v='2'; date -d "now + $v weeks" But in awk it does not, as in: v="2" "date -d 'now + v weeks'" | getline newdate close ("date -d 'now... (3 Replies)
Discussion started by: fbird3
3 Replies
DHEXRC(5)						      BSD File Formats Manual							 DHEXRC(5)

NAME
dhexrc -- Configuration File for dhex DESCRIPTION
dhexrc is the configuration file that specifies the colorscheme and the key translation tab for dhex(1), Upon starting the program, it is being read and parsed. It is being written and/or created after invoking the keyboard setup. EXAMPLE A typical .dhexrc file looks like this: '#DHEXCOLORSCHEME' '#VERSION 0' '#possible colors are: BLACK,RED,GREEN,YELLOW,BLUE,MAGENTA,CYAN,WHITE' '#possible extra flags are: UNDERLINE,REVERSE,BLINK,DIM,BOLD' 'BRACKETS: FG=BLACK,BG=BLACK,BOLD' 'HEXFIELD: FG=WHITE,BG=BLACK' 'INPUT: FG=BLACK,BG=WHITE' 'CURSOR: FG=WHITE,BG=BLACK' 'TEXT: FG=WHITE,BG=BLACK,BOLD' 'MENU_NORMAL: FG=CYAN,BG=BLACK' 'MENU_HIGHLIGHT: FG=BLACK,BG=CYAN' 'MENU_HOTKEY: FG=YELLOW,BG=BLACK,BOLD' 'MENU_HOTKEY_HI: FG=YELLOW,BG=CYAN,BOLD' 'FRAME: FG=BLUE,BG=BLACK,BOLD' 'NORMAL_DIFF: FG=YELLOW,BG=BLACK' 'CURSOR_DIFF: FG=YELLOW,BG=WHITE,BOLD' 'HEADLINE: FG=BLUE,BG=BLACK,BOLD' 'HEADER: FG=BLACK,BG=CYAN' 'KEYF1:1b 5b 31 31 7e' 'KEYF2:1b 5b 31 32 7e' 'KEYF3:1b 5b 31 33 7e' 'KEYF4:1b 5b 31 34 7e' 'KEYF5:1b 5b 31 35 7e' 'KEYF6:1b 5b 31 37 7e' 'KEYF7:1b 5b 31 38 7e' 'KEYF8:1b 5b 31 39 7e' 'KEYF9:1b 5b 32 30 7e' 'KEYF10:1b 5b 32 31 7e' 'KEYESC:1b' 'KEYBACKSPACE:08' 'KEYDEL:7f' 'KEYENTER:0a' 'KEYTAB:09' 'KEYUP:1b 5b 41' 'KEYDOWN:1b 5b 42' 'KEYRIGHT:1b 5b 43' 'KEYLEFT:1b 5b 44' 'KEYPGUP:1b 5b 35 7e' 'KEYPGDOWN:1b 5b 36 7e' 'KEYHOME:1b 5b 37 7e' 'KEYEND:1b 5b 38 7e' OPTIONS
In the example above, the dhexrc file has three distinct sections: A comment section, a color section and a key conversion tab section. Comments Comments are indicated with a '#' character. Everything afterwards in a line is being ignored when parsing the file Color section There are 14 color groups. Each of the color group has a foreground color, a background color and some extra flags, coming from ncurses. The foreground color is being defined by FG= while the background color is being defined by BG=. They and the extra flags are being separated by ','. Possible colors are BLACK, GREEN, RED, YELLOW, BROWN, BLUE, MAGENTA, WHITE, and exclusively as foreground colors LIGHTBLACK, LIGHTGREEN, LIGHTRED, LIGHTYELLOW, LIGHTBROWN, LIGHTBLUE, LIGHTMAGENTA and LIGHTWHITE. Valid extra flags are UNDERLINE, REVERSE, BLINK, DIM and BOLD. The color pairs are as followed: BRACKETS: This specifies the color for the brackets around text fields. HEXFIELD: This specifies the color in which the file's content is being shown. INPUT: When entering text, it is in this color. CURSOR: The cursor in the hex field has this color. TEXT: This color is for informative text as well as for text fields which are not taking input yet. MENU_NORMAL: Menu items which are not selected belong into this color group. MENU_HIGHLIGHT: The selected menu item gets this special color. MENU_HOTKEY: Hotkeys for menu items are visually distinct from the rest of the text because they have this color. MENU_HOTKEY_HI: If the actual menu item has a hotkey, it is shown in this color. FRAME: Some screens have frames. Those frames have this color. NORMAL_DIFF: Differences in the file's content (either because of changes or because dhex is running in diff mode) are indicated by this color. CURSOR_DIFF: If the cursor is on one of those differences, it will have this color. HEADLINE: On top of the screen, there is a headline. Which is shown in this color. HEADER: In the headline, there are brackets. Within those brackets is the header. It tells you what the window is all about. Key conversion tab section When pressing a "standard" key, something which can be mapped directly to an ascii character, only this character will end up in ncurses' buffer. However, pressing special keys like (for example) F1 or ALT+6 will produce longer sequences. Mapping those sequences back to a spe- cific key is the job of the key conversion tab. (I was dissatisfied how ncurses handled this on its own). The sequences are called (in order) KEYF1, KEYF2, KEYF3, KEYF4, KEYF5, KEYF6, KEYF7, KEYF8, KEYF9, KEYF10, KEYESC, KEYBACKSPACE, KEYDEL, KEYENTER, KEYTAB, KEYUP, KEYDOWN, KEYRIGHT, KEYLEFT, KEYPGUP, KEYPGDOWN, KEYHOME and KEYEND. Sequences itself are a string of lower case hex-values, each two nibbles long. Currently, there is no way of adding an alternative sequence to the same key. It is possible that the sequence made up of hex values does not REALLY belong to the key. (For example if F2 was pressed in the setup program when F1 was prompted). However, when this sequence ends up in the ncurses buffer, it is being interpreted as if that key was pressed. BUGS
Report bugs to <dettus@dettus.net>. Make sure to include DHEX somewhere in the subject. AUTHOR
Written by Thomas Dettbarn SEE ALSO
dhex(1), dhex_markers(5), dhex_searchlog(5) BSD
May 12, 2012 BSD
All times are GMT -4. The time now is 09:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy