Sponsored Content
Top Forums Shell Programming and Scripting How to escape "*" using awk inside script? Post 303046041 by vgersh99 on Wednesday 22nd of April 2020 09:41:51 AM
Old 04-22-2020
you probably have a file named Qm6Pnw in the direfctory you're running these commands in.
try:
Code:
a="$(awk '$2=="jij" {print $3}' testfile)"
echo "$a"

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Solaris

Solaris escape my script from "-" to "/226"

Hello everyone. I beg your guys pardon please. I try to ls -al in many path/directories. So, I put the code in text file which look like below; ls -al / ls -al /etc ls -al /etc/default ... however, when I paste it to Solaris over SecureCRT, it seems the code was escaped from "-" to... (0 Replies)
Discussion started by: Smith
0 Replies

3. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

4. Shell Programming and Scripting

Simplify Bash Script Using "sed" Or "awk"

Input file: 2 aux003.net3.com error12 6 awn0117.net1.com error13 84 aux008 error14 29 aux001.ha.ux.isd.com error12 209 aux002.vm.ux.isd.com error34 21 alx0027.vm.net2.com error12 227 dux001.net5.com error123 22 us008.dot.net2.com error121 13 us009.net2.com error129Expected Output: 2... (4 Replies)
Discussion started by: sQew
4 Replies

5. Shell Programming and Scripting

Awk to Search and Replace inside the pipe "|"

Hi, Anyone can help me on how to replace the qoutes inside the pipe | in my Text File like belows; "AAAA"|"Test "1-A""|"Test AAAA"|"This is A" "BBBB"|"Test "1-B""|"Test BBBB"|"This is B" "CCCC"|"My Test C"|"Test "CCCC""|"This is C" The output I need like belows; "AAAA"|"Test 1-A"|"Test... (12 Replies)
Discussion started by: fspalero
12 Replies

6. 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

7. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

8. Shell Programming and Scripting

Passing username and password to a script running inside "expect" script

Hi I'm trying to run a script " abc.sh" which triggers "use.sh" . abc.sh is nothing but a "expect" script which provides username and password automatically to the use.sh script. Please find below the scripts: #abc.sh #!/usr/bin/expect -f exec /root/use.sh expect "*name*" send... (1 Reply)
Discussion started by: baddykam
1 Replies

9. Shell Programming and Scripting

How to increment date using "for loop" in format MMDDYY inside the shell script?

Need to increment the date from "currentdate + 90days" inside the for loop (i=1 to i=50) (5 Replies)
Discussion started by: aroragaurav.84
5 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
tkconrc(5)							File Formats Manual							tkconrc(5)

__________________________________________________________________________________________________________________________________________________

NAME
tkconrc - TkCon resource file DESCRIPTION
TkCon will search for a resource file in "~/.tkconrc". TkCon never sources the "~/.wishrc" file. The resource file is sourced by each new instance of the console. An example resource file is provided below. The file itself is a Tcl script, so it is required that the file conforms to Tcl script conventions. VARIABLES
Certain variables in TkCon can be modified to suit your needs. It's easiest to do this in the resource file, but you can do it when time the program is running (and some can be changed via the Prefs menu). All these are part of the master interpreter's ::tkcon namespace. The modifiable array variables are ::tkcon::COLOR and ::tkcon::OPT. You can call tkcon set ::tkcon::COLOR when the program is running to check its state. Here is an explanation of certain variables you might change or use: ::tkcon::COLOR(bg) The background color for tkcon text widgets. Defaults to the operating system default (determined at startup). ::tkcon::COLOR(blink) The background color of the electric brace highlighting, if on. Defaults to yellow. ::tkcon::COLOR(cursor) The background color for the insertion cursor in tkcon. Defaults to black. ::tkcon::COLOR(disabled) The foreground color for disabled menu items. Defaults to dark grey. ::tkcon::COLOR(proc) The foreground color of a recognized proc, if command highlighting is on. Defaults to dark green. ::tkcon::COLOR(var) The background color of a recognized var, if command highlighting is on. Defaults to pink. ::tkcon::COLOR(prompt) The foreground color of the prompt as output in the console. Defaults to brown. ::tkcon::COLOR(stdin) The foreground color of the stdin for the console. Defaults to black. ::tkcon::COLOR(stdout) The foreground color of the stdout as output in the console. Defaults to blue. ::tkcon::COLOR(stderr) The foreground color of stderr as output in the console. Defaults to red. ::tkcon::OPT(autoload) Packages to automatically load into the slave interpreter (i.e. 'Tk'). This is a list. Defaults to {} (none). ::tkcon::OPT(blinktime) The amount of time (in millisecs) that braced sections should blink for. Defaults to 500 (0.5 secs), must be at least 100. ::tkcon::OPT(blinkrange) Whether to blink the entire range for electric brace matching or to just blink the actual matching braces (respectively 1 or 0, defaults to 1). ::tkcon::OPT(buffer) The size of the console scroll buffer (in lines). Defaults to 512. ::tkcon::OPT(calcmode) Whether to allow expr commands to be run at the command line without prefixing them with expr (just a convenience). ::tkcon::OPT(cols) Number of columns for the console to start out with. Defaults to 80. ::tkcon::OPT(dead) What to do with dead connected interpreters. If dead is leave, TkCon automatically exits the dead interpreter. If dead is ignore then it remains attached waiting for the interpreter to reappear. Otherwise TkCon will prompt you. ::tkcon::OPT(exec) This corresponds to the -exec tkcon option (see tkcon(1)). ::tkcon::OPT(font) Font to use for tkcon text widgets (also specified with -font option). Defaults to the system default, or a fixed width equivalent. ::tkcon::OPT(gets) Controls whether tkcon will overload the gets command to work with tkcon. The valid values are: congets (the default), which will redirect stdin requests to the tkcon window; gets, which will pop up a dialog to get input; and {} (empty string) which tells tkcon not to overload gets. This value must be set at startup to alter tkcon's behavior. ::tkcon::OPT(history) The size of the history list to keep. Defaults to 48. ::tkcon::OPT(hoterrors) Whether hot errors are enabled or not. When enabled, errors that are returned to the console are marked with a link to the error info that will pop up in an minimal editor. This requires more memory because each error that occurs will maintain bindings for this feature, as long as the error is in the text widget. Defaults to on. ::tkcon::OPT(library) The path to any tcl library directories (these are appended to the auto_path when the after the resource file is loaded in). ::tkcon::OPT(lightbrace) Whether to use the brace highlighting feature or not (respectively 1 or 0, defaults to 1). ::tkcon::OPT(lightcmd) Whether to use the command highlighting feature or not (respectively 1 or 0, defaults to 1). ::tkcon::OPT(maineval) A tcl script to execute in the main interpreter after the slave interpreter is created and the user interface is initialized. ::tkcon::OPT(maxlinelen) A number that specifies the limit of long result lines. True result is still captured in $_ (and 'puts $_' works). Defaults to 0 (unlimited). ::tkcon::OPT(maxmenu) A number that specifies the maximum number of packages to show vertically in the Interp->Packages menu before breaking into another column. Defaults to 15. ::tkcon::OPT(nontcl) For those who might be using non-Tcl based Tk attachments, set this to 1. It prevents TkCon from trying to evaluate its own Tcl code in an attached interpreter. Also see my notes for non-Tcl based Tk interpreters. ::tkcon::OPT(prompt1) Like tcl_prompt1, except it doesn't require you use puts. No equivalent for tcl_prompt2 is available (it's unnecessary IMHO). Defaults to {([file tail [pwd]]) [history nextid] % }. ::tkcon::OPT(rows) Number of rows for the console to start out with. Defaults to 20. ::tkcon::OPT(scollypos) Y scrollbar position. Valid values are left or right. Defaults to right. ::tkcon::OPT(showmenu) Show the menubar on startup (1 or 0, defaults to 1). ::tkcon::OPT(showmultiple) Show multiple matches for path/proc/var name expansion (1 or 0, defaults to 1). ::tkcon::OPT(slaveeval) A tcl script to execute in each slave interpreter right after it's created. This allows the user to have user defined info always available in a slave. Example: set ::tkcon::OPT(slaveeval) { proc foo args { puts $args } lappend auto_path . } ::tkcon::OPT(slaveexit) Allows the prevention of exit in slaves from exitting the entire application. If it is equal to exit, exit will exit as usual, oth- erwise it will just close down that interpreter (and any children). Defaults to close. ::tkcon::OPT(subhistory) Allow history substitution to occur (0 or 1, defaults to 1). The history list is maintained in a single interpreter per TkCon con- sole instance. Thus you have history which can range over a series of attached interpreters. EXAMPLES
An example TkCon resource file might look like: ###################################################### ## My TkCon Resource File # Use a fixed default font #tkcon font fixed; # valid on unix #tkcon font systemfixed; # valid on win tkcon font Courier 12; # valid everywhere # Keep 50 commands in history set ::tkcon::OPT(history) 50 # Use a pink prompt set ::tkcon::COLOR(prompt) pink ###################################################### SEE ALSO
dump(n), idebug(n), observe(n), tkcon(1), tkcon(n) KEYWORDS
Tk, console COPYRIGHT
Copyright (c) Jeffrey Hobbs <jeff at hobbs.org> TkCon 2.5 tkconrc(5)
All times are GMT -4. The time now is 06:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy