Sponsored Content
Top Forums Shell Programming and Scripting How to copy particular record with cp command Post 302358841 by devmns on Monday 5th of October 2009 02:26:01 AM
Old 10-05-2009
awk '$3>=20{print}' inputfile > outputfile

This is not giving the required output. Infact, this is adding "20" figure in the table as a sepeare column.

I want only.

Code:
                   1 Colgate        23     34564    col
                   2 ParkAvenue 118     45456    par
                   4 Lipton          23     56234    lip

rows in my final answer , since price of these product is greater than (>=20)

Last edited by Franklin52; 10-05-2009 at 05:56 AM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

fl command - set record length

Hi, I have a KSH shell script running on hpux that uses the fl command - ex: cat /foo | fl 50 > bar This command will take each record in the file foo, make it 50 characters long and then write it to the file bar. my problem is that I am porting my scripts over to solaris which doesn't... (2 Replies)
Discussion started by: Tom Siegel
2 Replies

2. UNIX for Dummies Questions & Answers

command to remove last record on file

Hi, First time on the forum. I have converted some files using the Unix to DOS command but need to strip off the last record that is generated from this conversion that contains just a ^Z. Is there any command that would accomplish this without having to do stream editing? (4 Replies)
Discussion started by: mheinen
4 Replies

3. UNIX for Advanced & Expert Users

Command nee to cut the record

I have a file which contains a record like follows /dir1/dir2/dir3/file.dat I need command to so that output can be only file.dat (6 Replies)
Discussion started by: sreenusola
6 Replies

4. UNIX for Dummies Questions & Answers

Need a command to get part of a record from file

I have a file which contains a record like follows /dir1/dir2/dir3/file.dat I need command so that output can be only file.dat (4 Replies)
Discussion started by: sreenusola
4 Replies

5. UNIX for Advanced & Expert Users

command to insert a record at a particular loaction

Hi, Is there any command to insert a line in between two lines? My input data is as below: 1|ETG|63121387883|Alternate|Y 3|79.58|||GBP|| 4|001137001 4|0011372 5|1021701 5|1021901 1|ETG|63121387884|Alternate|Y 3|79.58|||GBP|| 4|001137001 5|1021702 5|1021802... (1 Reply)
Discussion started by: laxmi131
1 Replies

6. Shell Programming and Scripting

Unix command to extract a record from a table

Suppose there is a table like the following...I just wanted to know if there is any command using which we can get the record/name of the person who joined before 2005.. Sl Name des y.o.joining 1 Ram Engineer 2001 2 Hari Doctor 2004 3 David Plumber 2005 4 Rahim painter 2007 5 gurmeet... (1 Reply)
Discussion started by: satyajit007
1 Replies

7. Shell Programming and Scripting

Shell script for searching a record,copy to a file and then delete it

Hi, I have a requirement in hand: I have a file with millions of records say file 1.I have another file, say file 2 which has 2000 records in it. The requirement is to read file2 , and remove the read record from file 1 and move i to a seperate file, file 3. For eg: Read file 2, get the... (5 Replies)
Discussion started by: kumara2010
5 Replies

8. Shell Programming and Scripting

Record all users' command

Hi experts, .history can record one user's own command history, but my request is, I want to record all users who run commands on that box, and export the commands to a file somewhere, which record the userid, time and full command. Is it possible? I just need for audit, and trace back, if... (3 Replies)
Discussion started by: newoz
3 Replies

9. UNIX for Dummies Questions & Answers

how to copy files and record original file location?

:EDIT: I think my post name should have been labeled: how to copy files and record original file location. not "retain". Hello, this is my first post! I searched the forums a lot before posting, but was unable to answer my question. Here's my problem: There are several hundred text files... (4 Replies)
Discussion started by: willie8605
4 Replies

10. AIX

Record topas command output

How to record output of below command in a text file. topas -P or is there any other command which will do the same thing in AIX. I would like to get a report something similar to below commands. top -b prstat -c (5 Replies)
Discussion started by: NarayanaPrakash
5 Replies
script(1)							   User Commands							 script(1)

NAME
script - make record of a terminal session SYNOPSIS
script [-a] [filename] DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript. See WARNINGS. The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends when the forked shell exits or when Control-d is typed. OPTIONS
The following option is supported: -a Appends the session record to filename, rather than overwriting it. NOTES
script places everything that appears on the screen in filename, including prompts. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a privileged user, that is, root. Be sure that typescript is not a link before running script. SunOS 5.11 30 Jan 2004 script(1)
All times are GMT -4. The time now is 01:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy