Sponsored Content
Top Forums Shell Programming and Scripting Inserting variable values in filename Post 302790211 by balajesuri on Friday 5th of April 2013 02:36:48 AM
Old 04-05-2013
Code:
[user@host ~]# cat file
assa  dsad werr vdss a.txt is 2.4
assa  dsad werr vdss b.txt is 3.2
assa  dsad werr vdss c.txt is 4.3
[user@host ~]# awk '{sub(/.txt/,"",$5); print $5"_"$7}' file
a_2.4
b_3.2
c_4.3
[user@host ~]#

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inserting Values From A File Into A Table

Guys, I want to insert some values from a log file into a temporary table. the values in the log file looks like this SV_NAME CC_NAME CP_DISP_RUN_STATE ------- ------------------- ----------------- sble01 ALLTEL WorkMon24Hrs Running I want to enter the... (2 Replies)
Discussion started by: ragha81
2 Replies

2. Shell Programming and Scripting

help in inserting values in date format

how to assign values in this date format a=`date +"%H%M%S"` how to give value of H=22,here in this format so that i can grep 22nd hour.Below is the script -------------------------------------------------------------------------- a=`date +"%H%M%S"` for i in *.log do cat $i | grep $a... (3 Replies)
Discussion started by: ali560045
3 Replies

3. Shell Programming and Scripting

Inserting variable value into filename

Greetings, people of UNIX/Linux forums. I am having a problem with a script, where I am trying to create a new variable. The value of this variable would be dependent on the value in a couple other previous variables (all variables are 2-digit integers). Here is my code: #set the stations... (3 Replies)
Discussion started by: TheSMan5
3 Replies

4. Shell Programming and Scripting

inserting a variable to a new line

In my script I am using sed to insert a line. Suppose I have a variable called ck_size=5 and a temporary file called tmp I want to add a certain line in the tmp file .Please see the below command sed -i '2a\maitee is $ck_size' /dun/homes/lrsprod/tmp I want in 2 line of tmp file... (7 Replies)
Discussion started by: maitree
7 Replies

5. Shell Programming and Scripting

modify a file by inserting a conditional values

Hi, input file CCCC 1204 215764.85 9405410.40 1189 DDDD 4498 1503 4617 1507 4723 1517 4829 1528 4996 1540 DDDD 5199 1556 5278 1567 5529 1603 5674 1614 6076 1915 DDDD 6605 2371 7004 2779 CCCC ... (4 Replies)
Discussion started by: Indra2011
4 Replies

6. Shell Programming and Scripting

Inserting filename at the top of file

Hi Forum members, I want to insert the filename at the top of file (i.e, first row only) My file name is like asdf_432 And I want to insert this filename in first row as filename is asdf with serial no. 432 Thanks in advance. :) (4 Replies)
Discussion started by: CAch
4 Replies

7. Shell Programming and Scripting

Problem in inserting values of variable of shell

hi all, i have one shell script like this #!/bin/bash -xv ENV_NAME=`cat $IB_HOME_DIR/cfg/ibProfile.sh | grep "RDM_CONN" | cut -f 2 -d "@"` CURRENT_DIR=`pwd`; string=$IB_HOME_DIR string1="$string/FRGFOLDER/input" #sed "s/string3/$string1" frg_event_src.sql > modifiedinsert.sql sqlplus... (2 Replies)
Discussion started by: ramsavi
2 Replies

8. UNIX for Dummies Questions & Answers

Inserting a variable in awk script

I have file input.txt: >TX1-1 Freq 55 cattctgatgaatatttgtcctttagttgttatttgt >TX1-2 Freq 19 cattctgatgaatatttgtcctttagttgttatttgt >TX1-3 Freq 17 cattctgatgaatatttgtcctttagttgttatttgt >TX1-4 Freq 6 cattctgatgaatatttgtcctttagttgttatttgt >TX1-5 Freq 6 cattctgatgaatatttgtcctttagttgttatttgt ... (5 Replies)
Discussion started by: Xterra
5 Replies

9. Shell Programming and Scripting

Inserting values into database from an excel

Hi, I have a requirement where I have an excel sheet with the below values COL1 COL2 COL3 Germany URGENT NORMAL I want to cut the values of this excel in such a way that I get the values and pass it to an insert statement update tbfin set... (2 Replies)
Discussion started by: venkidhadha
2 Replies

10. Shell Programming and Scripting

Inserting values to database

hi , I'm new to Unix shell scripting. I need help to insert read csv which has two columns -emp no and logged date. csv file is a large file so i want to keep the insertion query in a separate .sql file. csv file looks this: empno | loggeddate ___________________ 5666 ,... (5 Replies)
Discussion started by: preema
5 Replies
XTERMCONTROL(1) 						   User Commands						   XTERMCONTROL(1)

NAME
xtermcontrol - dynamic control of XFree86 xterm properties. SYNOPSIS
xtermcontrol [OPTIONS]... DESCRIPTION
xtermcontrol makes it easy to change colors, title, font and geometry of a running XFree86 xterm(1), as well as to report the current set- tings of the aforementioned properties. Window manipulations de-/iconify, raise/lower, maximize/restore and reset are also supported. To complete the feature set; xtermcontrol lets advanced users issue any xterm control sequence of their choosing. OPTIONS
--fg=COLOR Set foreground color (see also COLOR NAMES). --bg=COLOR Set background color. --colorN=COLOR Set N'th [0-15] color. --highlight=COLOR Set highlight color. --cursor=COLOR Set cursor color. --mouse-fg=COLOR Set mouse pointer foreground color. --mouse-bg=COLOR Set mouse pointer background color. --font=FONT Set font name (see also FONT NAMES). Alternatively it is possible to specify a fontmenu index as '#[0-6]' or navigate the fontmenu by relative sizes as '#+N' or '#-N', where N is an optional integer. --title=STRING Set window title. Note that mechanisms like the bash(1) PROMPT_COMMAND may overwrite the title. --geometry=WIDTHxHEIGHT+XOFF+YOFF Set size and/or position. Through its control sequences the xterm only recognize positive XOFF and YOFF offsets, which are pixels relative to the upper left hand corner of the display. xtermcontrol is therefore unable to handle negative offsets as described in the X(7x) GEOMETRY SPECIFICATIONS and therefore truncates negative values to zero. --get-fg Report foreground color. --get-bg Report background color. --get-colorN Report N'th [0-15] color. --get-highlight Report highlight color. --get-cursor Report cursor color. --get-mouse-fg Report mouse pointer foreground color. --get-mouse-bg Report mouse pointer background color. --get-font Report font. --get-title Report window title. --get-geometry Report size and position. The size of the text area is reported in characters and the position is reported in pixels relative to the upper left hand corner of the display. --maximize Maximize window. --restore Restore maximized window. --iconify Iconify window. --de-iconify De-iconify window. --raise Raise window. --lower Lower window. --reset Full reset. --raw=CTLSEQS Issue raw control sequence (see also XTERM CONTROL SEQUENCES). --file=FILE Force xtermcontrol to read configurations (see also CONFIGURATION) from FILE instead of the standard personal initialization file ~/.xtermcontrol. --force, -f Skip TERM environment variable check. --verbose, -v Print verbose reports. --help, -h Print help message and exit. --version Print the version number and exit. CONFIGURATION
xtermcontrol reads a default, ~/.xtermcontrol, or a user specified configuration file on startup. Each line in the file is either a com- ment or contains an attribute. Attributes consist of a keyword and an associated value: keyword = value # comment The valid keyword/value combinations are: foreground="COLOR" background="COLOR" highlight="COLOR" cursor="COLOR" mouse-foreground="COLOR" mouse-background="COLOR" geometry="WIDTHxHEIGHT+XOFF+YOFF" font="FONT" color0="COLOR" color1="COLOR" color2="COLOR" color3="COLOR" color4="COLOR" color5="COLOR" color6="COLOR" color7="COLOR" color8="COLOR" color9="COLOR" color10="COLOR" color11="COLOR" color12="COLOR" color13="COLOR" color14="COLOR" color15="COLOR" Whitespace is ignored in attributes unless within a quoted value. The character '#' is taken to begin a comment. Each '#' and all remaining characters on that line is ignored. FONT NAMES
xtermcontrol accepts any X(7x) FONT NAMES. Font names like '-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1' are very cumber- some to write, so it is convenient to make use of aliases, e.g. 'fixed' or '8x13', if present in fonts.alias files of the font directo- ries. COLOR NAMES
xtermcontrol accepts any X(7x) COLOR NAMES. Basically this means that colors are specified by name or rgb value, e.g. 'blue', 'rgb:0000/0000/FFFF' or '#00F'. Colors are typically reported by the xterm in a device-dependent numerical form, e.g. 'rgb:0000/0000/FFFF'. Note that old syntax rgb values should always be quoted to avoid '#' being interpreted as the beginning of a comment by the shell (see also FILES). XTERM CONTROL SEQUENCES
The secret behind xtermcontrol is xterm control sequences. All the possible (there are a plethora of them) control sequences are documented in ctlseqs.txt, found in the xterm(1) distribution (see also FILES). TROUBLESHOOTING
If read/write permissions on the tty's are changed so that special group membership is required to be able to write to the pseudo terminal, the easiest workaround is to install xtermcontrol setuid root. Xterm(1) has three resources, allowWindowOps, allowTitleOps, and allowFontOps, that enables or disables special operations which xtermcon- trol relies on. If any of these resources are set (or defaults) to 'false' xtermcontrol may hang. The resources corresponds to xtermcon- trol options as: allowWindowOps: --raise --lower --restore --maximize --iconify --de-iconify --get-title --geometry --get-geometry allowTitleOps: --title allowFontOps: --font --get-font All three resources can usually be enabled for the current xterm session via a menu; ctrl+rightclick and look for menu item names like 'Allow Window Ops'. To set these resource values persistently you can add the following to either your local ~/.Xdefaults file, or to a system-wide resource file like /etc/X11/app-defaults/XTerm: *VT100.allowWindowOps: true *VT100.allowTitleOps: true *VT100.allowFontOps: true FILES
<XRoot>/X11/rgb.txt Default rgb color name file location. ctlseqs.txt Xterm control sequences documentation. Distributed with xterm from http://dickey.his.com/xterm/ SEE ALSO
xterm(1), X(7x) COPYRIGHT
Copyright (C) 2002-2009 Jess Thrysoee <jess@thrysoee.dk> xtermcontrol 2.10 October 17, 2009 XTERMCONTROL(1)
All times are GMT -4. The time now is 10:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy