Sponsored Content
Top Forums Shell Programming and Scripting Variable interpolation in "print" of awk command Post 302601042 by forums123456 on Wednesday 22nd of February 2012 06:21:51 PM
Old 02-22-2012
Didn't worked.
Output from set -x is below. No Interpolation is happening.
I am using korn shell.
Code:
awk -F\t {print $$i}


Last edited by Franklin52; 02-23-2012 at 04:18 AM.. Reason: Please use code tags for code and data samples, thank you
 

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. Shell Programming and Scripting

ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt"

Hi, I don't know hot to make this command work: ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt" It should return the list of file .txt It's important to search .txt at the end of the line, becouse some file name have "txt" in their name but have other extensions (13 Replies)
Discussion started by: DNAx86
13 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

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

5. Shell Programming and Scripting

How can I pass variable to "awk" and use print ?

Problem comes with following command: $ a=2 $ awk 'NR==2 {print $2}' about.txt rights $ awk "NR==2 {print $2}" about.txt All rights reserved. Use is subject to license terms. ????why print all fields???? $ awk "NR==$a {print $2}" about.txt All rights reserved. Use is... (6 Replies)
Discussion started by: 915086731
6 Replies

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

7. Shell Programming and Scripting

awk "date" and "system" command

Hello experts! I need your help please I have a file.txt of which I want to extract 3rd and 4th columns with date with the form e.g.: 2016-11-25 03:14:50and pass them to "date" command, but also append the 9th column in a file as well. So I want to execute date -d '2016-11-25 03:14:50' ... (2 Replies)
Discussion started by: phaethon
2 Replies

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

9. Shell Programming and Scripting

Why awk print is strange when I set FS = " " instead of FS = "\t"?

Look at the following data file(cou.data) which has four fields separated by tab. Four fields are country name, land area, population, continent where it belongs. As for country name or continent name which has two words, two words are separated by space. (Data are not accurately... (1 Reply)
Discussion started by: chihuyu
1 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
PDL2(1p)						User Contributed Perl Documentation						  PDL2(1p)

NAME
pdl2 - Simple shell (version 2) for PDL SYNOPSIS
Use PDL interactively: %> pdl2 pdl> $a = sequence(10) # or any other perl or PDL command pdl> print "$a = $a "; $a = [0 1 2 3 4 5 6 7 8 9] DESCRIPTION
The "pdl2" program, also known as the Perldl2 shell, is a second generation version of the original "perldl" interactive PDL shell. It attempts to be backward compatible in usage while providing improved features, better support for Perl syntax, and an more easily extended framework based on the Devel::REPL shell. If you have Devel::REPL version 1.003011 or later, then "pdl2" will start with full functionality. If Devel::REPL is not installed or found then "pdl2" will print a warning and run the legacy "perldl" shell command instead. By default, command lines beginning with the default prompt of either "pdl2" or "perldl" (one of 'pdl> ', 'PDL> ', or 'perldl> ') will have the prefix string and surrounding whitespace stripped. This allows for easy cut-and-paste from sample PDL shell sessions or other examples into another PDL shell session. FUNCTIONS
do_print Toggle print-by-default on and off (default value: off) By default, "pdl2" does not print the results of operations since the results can be very large (e.g., a small 640x480 RGBA image is still more than 1_000_000 elements). However, for experimenting and debugging more complex structures, it helps to see the results of every operation. The "do_print" routine allows you to toggle between the default "quiet" operation and a full Read, Evaluate, Loop style. pdl> $a = pdl(3,2) pdl> do_print 1 pdl> $a = pdl(3,2) $PDL1 = [3 2]; pdl> do_print pdl> $a = pdl(3,2) VARIABLES
$PDL::toolongtoprint The maximal size pdls to print (defaults to 10000 elements). This is not just a "perldl" or "pdl2" variable but it is something that is usually needed in an interactive debugging session. SEE ALSO
perldl, Devel::REPL perl v5.14.2 2012-05-19 PDL2(1p)
All times are GMT -4. The time now is 03:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy