Sponsored Content
Top Forums Shell Programming and Scripting Adding more text to a variable Post 302751633 by RudiC on Friday 4th of January 2013 08:15:13 AM
Old 01-04-2013
in bash:
Code:
$ var+=" green"
$ echo $var
blue green

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

adding 0 to a variable

Can anybody plz help me to solve this puzzle? amt=00002280674231 ((amt = amt + 0)) # to remove leading zero's echo $amt prints -2014293065 but this works fine for numbers less than 2000000000. Thanks S (3 Replies)
Discussion started by: shivakundan
3 Replies

2. UNIX for Dummies Questions & Answers

adding PATH variable

Hello i use bash and i added a path variable for 2 files /rscr and /uscr in /etc/profile /rscr working fine but the other one shows command not found and when i try to type whereis for scripts in /rscr it shows them but the other one shows nothing... thanks :b: (3 Replies)
Discussion started by: wir3d
3 Replies

3. Shell Programming and Scripting

adding spaces for a variable value

Hi, i have to form the header and add fillers(spaces) to it. I have done something like this. i have added 10 spaces at the end HDR="AAAABBBBCCNN " echo $HDR >> file1.dat but the spaces are not being stored in the file. How to add the spaces. (2 Replies)
Discussion started by: dnat
2 Replies

4. Shell Programming and Scripting

Adding specific text and spaces to each line in a text file

Hi, I wanted to add specific text to each row in a text file containing three rows. Example: 0 8 7 6 5 5 7 8 9 0 7 9 7 8 9 0 1 2 And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this: 21 0 8 7 6 5 5 7 8... (4 Replies)
Discussion started by: hertingm
4 Replies

5. Shell Programming and Scripting

adding value to variable using expr

for i `cat abc.txt` do m= `expr $i + 2` echo $m done i wrote this script to assing value to m. but i got the error "a.sh: 423: not found" please help me to sort out this issue (2 Replies)
Discussion started by: Kochu77
2 Replies

6. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

7. Shell Programming and Scripting

Adding grep'd results in a variable

Here is one I am baffled with; I have not used unix for a while and now that I am back it has been fun remembering and I have enjoyed it, for the most past. this is in ksh. I need to search in a file for the line with X1 and cut columns 20-25, put them into a variable, added them (dollar... (3 Replies)
Discussion started by: CougarMutt
3 Replies

8. Shell Programming and Scripting

Adding Content to Variable (bash)

is this possible? its kind of like incrementing the value of a number in a variable. but in this case, instead of the value of the variable being a number, it's just contents/strings/characters/alpha-numeric etc. NOT a number. For instance: VAR=Tommy for all in $(blah blah) do ... (2 Replies)
Discussion started by: SkySmart
2 Replies

9. UNIX for Dummies Questions & Answers

[Help] Adding text to a variable line in a file

Hey guys, I need to write a script that will add a specific text at the end of a specific line (of a text file). but the line is a variable this is my text file : device_2 ansible_ssh_host=127.0.0.1 ansible_ssh_port=30000 ansible_ssh_user='root' device_2 ansible_ssh_host=127.0.0.1... (1 Reply)
Discussion started by: OdedOvdat
1 Replies

10. Shell Programming and Scripting

Adding text from a variable using sed (Or awk) with punctuation

Hi All, I would have though this would have been simple, but... I have text in a variable that I need to insert into a bunch of other files... The text is simple: ... (2 Replies)
Discussion started by: joeg1484
2 Replies
fb.modes(5)						     Linux frame buffer utils						       fb.modes(5)

NAME
fb.modes - frame buffer modes file DESCRIPTION
/etc/fb.modes contains an unlimited number of video mode descriptions. The general format of a video mode is: mode geometry <xres> <yres> <vxres> <vyres> <depth> timings <pixclock> <left> <right> <upper> <lower> <hslen> <vslen> options <value> rgba <red,green,blue,alpha> endmode OPTIONS
geometry options: xres visible horizontal resolution (in pixels) yres visible vertical resolution (in pixels) vxres virtual horizontal resolution (in pixels) vyres virtual vertical resolution (in pixels) depth display depth (in bits per pixel) timing options: pixclock length of one pixel (in picoseconds) left left margin (in pixels) right right margin (in pixels) upper upper margin (in pixel lines) lower lower margin (in pixel lines) hslen horizontal sync length (in pixels) vslen vertical sync length (in pixel lines) rgba options (only valid with truecolor): red red color bitfields (in length or length/offset) green green color bitfields (in length or length/offset) blue blue color bitfields (in length or length/offset) alpha alpha color bitfields (in length or length/offset) other options: the first value of this options is the default hsync {low|high} the horizontal sync polarity vsync {low|high} the vertical sync polarity csync {low|high} the composite sync polarity gsync {low|high} the sync on green polarity bcast {false|true} enable or disable broadcast modes. If enabled the frame buffer generates the exact timings fot several broadcast modes (e.g. PAL or NTSC). Note that this option may not be supported by every frame buffer extsync {false|true} enable or disable external resync. If enabled the sync timings are not generated by the frame buffer device and must be pro- vided externally instead. Note that this option may not be supported by every frame buffer device laced {false|true} enable or disable interlace. If enabled the display will be split in two frames, each frame contains only even and odd lines respectively. These two frames will be displayed alternating, this way twice the lines can be displayed and the vertical fre- quency for monitor stays the same, but the visible vertical frequency gets halved double {false|true} enable or disable doublescan. If enabled every line will be displayed twice and this way the horizontal frequency can easily be doubled, so that the same resolution can be displayed on different monitors, even if the horizontal frequency specifica- tion differs. Note that this option may not be supported by every frame buffer device nostd <number> select nonstandard video mode accel {false|true} enable or disable hardware text acceleration grayscale {false|true} enable or disable graylevels instead of colors INTERNALS
Generally a frame buffer display is organized as follows: +---+---------------+---+---+ | | ^ | | | | | | 5 | | | | | v | | | +---#################---+---+ | # ^ # | | | # | # | | | # | # | | | 1 # | 2 # 3 | 4 | |<->#<------+------>#<->|<->| | # | # | | | # | 6 # | | | # | # | | | # v # | | +---#################---+---+ | | ^ | | | | | | 7 | | | | | v | | | +---+---------------+---+---+ | | ^ | | | | | | 8 | | | | | v | | | +---+---------------+---+---+ 1 left margin 2 xres 3 right margin 4 horizontal sync len 5 upper margin 6 yres 7 lower margin 8 vertical sync len The area bordered with `#' is the visible display area. Horizontal and vertical frequencies can now easily be calculated, for this the sum of horizontal or vertical values are important htotal = left + xres + right + hslen vtotal = upper + yres + lower + vslen The length of one line can now be calculated with pixclock line = pixclock * htotal and we have the horizontal frequency hfreq = 1E12 / line = 1E12 / (pixclock * htotal) To get the vertical frequency vtotal must eventually adjusted. If the display is laced, vtotal must be halved or if the display is a dou- blescan one, vtotal must be doubled. Now we can calculate the length of one frame if (lace) vtotal /= 2 if (double) vtotal *= 2 frame = vtotal * line and we get also the vertical frequency vfreq = 1E12 / frame = hfreq / vtotal SEE ALSO
fbset(8), fbdev(4) 2.1 2003-08-07 fb.modes(5)
All times are GMT -4. The time now is 01:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy