Sponsored Content
Top Forums Shell Programming and Scripting Search term and output term in desired field Post 302108387 by Raynon on Monday 26th of February 2007 06:34:01 AM
Old 02-26-2007
Quote:
Originally Posted by anbu23
Code:
perl -lane 'if (/ddd/) { print $F[2] } ' file

Hi Anbu,

Your perl script works. But how can i make it in a form where i can place it in the format below (known as test.pl) below where i can just type perl test.pl, the ouput will be out.

Code:
#!/usr/bin/perl 

#contains some other codes as well

perl -lane 'if (/ddd/) { print $F[2] } ' file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

X-Term for Windows

Hi Everyone, I need some information from all of you guys. I generally work on a Solaris OS in my school and I had heard that I can download something called X-Term on a Windows system and still work on some of the graphical things on windows which generally work only on unix. This is what I... (5 Replies)
Discussion started by: yelamarthi
5 Replies

2. Programming

Create a Term & Run chars on this Term

hi floks ! i'd like to know how can i transmete a character or a string from my source code to a term and make it interpret or un by the shell wich is running in my term. I'd like to create a Term from my code (and get its file descriptor) and then transmete each char typed on the keyboard to... (1 Reply)
Discussion started by: the_tical
1 Replies

3. Shell Programming and Scripting

Help with TERM script

I am trying to amend an existing TERM script to prompt the end user for a password - then take that password and add it to a specific part of an existing file. Here is what I have - BUT - I am confusing Unix with Term and my script does not like what I added b/c the script simply runs through... (1 Reply)
Discussion started by: Surdeymon
1 Replies

4. Programming

How to stop other processes and kernel from printing output on current virtual term

Hello All, Background ======== I am creating a virtual appliance console for a software stack on VMware ESXi. I am using Centos 5.x as the Linux distro (Guest OS). I have created a ncurses based application that does the user authentication and present him with some basic controls to do basic... (2 Replies)
Discussion started by: ku@ntum
2 Replies

5. Shell Programming and Scripting

Search term highlighting using "less"

I'm using less to find terms in a 6 gb text file in OS X in the terminal. When I first search for the patter, it finds it, scrolls the document to the correct location, and highlights it. But when I search again, the document scrolls to a new further location (I'm assuming it's found the pattern... (2 Replies)
Discussion started by: garethson
2 Replies

6. Shell Programming and Scripting

killproc -term

Hi, I am trying the function killproc -term and it seems to be doing something extra that kill <pid> doesn't do. My daemon cleanly terminates using kill, but not using killproc. I tried strace on killproc and then killproc works well. I read online that strace ignores SIGSTOP. does that mean... (4 Replies)
Discussion started by: fosfat
4 Replies

7. UNIX for Dummies Questions & Answers

qvt term with windows xp

I.m using qvt term to convert my windows xp laptop to work with sun ultra 5 unix system but i can't connect - my settings are off and i can't figure it out - i have a feeling it is my serial port # the porgramm is asking for. Can someone tell me where i can find this number. thanks Christine (9 Replies)
Discussion started by: lucenta tire
9 Replies

8. Shell Programming and Scripting

extracting a column using search term

I am trying to select a column using a search term. My input file looks like this (tab delimited): ABC BJS FDG GHH DGH DFG GHF 95 456 5 266 87 4567 67 3 54 678 4567 45 6 36 232 55 3 5 6 8 34 cat filename | awk '{print $2}'above code will give me the second column. However, what I want... (2 Replies)
Discussion started by: SangLad
2 Replies

9. Shell Programming and Scripting

Search term in nth field and replace kth column

Hi, I have a text file which looks like this a.txt A,12,Apple,Red B,33,Banana,Yellow C,66,Sky,Blue I need to search for a particular field(s) in particular column(s) and for that matching line need to replace the nth column. Sample scenario 1: Search for 66 in second field and Sky in... (5 Replies)
Discussion started by: wahi80
5 Replies

10. UNIX for Beginners Questions & Answers

Error term undefined

i keep getting this error when i ssh using my id - any idea (2 Replies)
Discussion started by: tariq_m
2 Replies
PERLIVP(1)						 Perl Programmers Reference Guide						PERLIVP(1)

NAME
perlivp - Perl Installation Verification Procedure SYNOPSIS
perlivp [-a] [-p] [-v] [-h] DESCRIPTION
The perlivp program is set up at Perl source code build time to test the Perl version it was built under. It can be used after running: make install (or your platform's equivalent procedure) to verify that perl and its libraries have been installed correctly. A correct installation is verified by output that looks like: ok 1 ok 2 etc. OPTIONS
-h help Prints out a brief help message. -a run all tests Normally tests for optional features are skipped. With -a all tests are executed. -p print preface Gives a description of each test prior to performing it. -v verbose Gives more detailed information about each test, after it has been performed. Note that any failed tests ought to print out some extra information whether or not -v is thrown. DIAGNOSTICS
o print "# Perl binary `$perlpath' does not appear executable. "; Likely to occur for a perl binary that was not properly installed. Correct by conducting a proper installation. o print "# Perl version `$]' installed, expected $ivp_VERSION. "; Likely to occur for a perl that was not properly installed. Correct by conducting a proper installation. o print "# Perl @INC directory `$_' does not appear to exist. "; Likely to occur for a perl library tree that was not properly installed. Correct by conducting a proper installation. o print "# Needed module `$_' does not appear to be properly installed. "; One of the two modules that is used by perlivp was not present in the installation. This is a serious error since it adversely affects perlivp's ability to function. You may be able to correct this by performing a proper perl installation. o print "# Required module `$_' does not appear to be properly installed. "; An attempt to "eval "require $module"" failed, even though the list of extensions indicated that it should succeed. Correct by conducting a proper installation. o print "# Unnecessary module `bLuRfle' appears to be installed. "; This test not coming out ok could indicate that you have in fact installed a bLuRfle.pm module or that the "eval " require "$module_name.pm"; "" test may give misleading results with your installation of perl. If yours is the latter case then please let the author know. o print "# file",+($#missing == 0) ? '' : 's'," missing from installation: "; One or more files turned up missing according to a run of "ExtUtils::Installed -> validate()" over your installation. Correct by conducting a proper installation. o print "# Perl header `$_' does not appear to be properly installed. "; Correct by running h2ph over your system's C header files. If necessary, edit the resulting *.ph files to eliminate perl syntax errors. For further information on how to conduct a proper installation consult the INSTALL file that comes with the perl source and the README file for your platform. AUTHOR
Peter Prymmer perl v5.12.4 2013-03-18 PERLIVP(1)
All times are GMT -4. The time now is 06:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy