Sponsored Content
Top Forums UNIX for Dummies Questions & Answers help with displaying certain lines Post 4597 by kapilv on Friday 27th of July 2001 01:13:00 AM
Old 07-27-2001
hi

Try giving this
awk '$2 >= 06 && $2 < 12 {print}' test.txt
test.txt is the file which will contain
00 07 * * * /home/production/bin/xxx.ksh
00 08 * * * /home/production/bin/xyz.ksh
00 12 * * * /home/production/bin/tuv.ksh
30 06 * * * /home/production/bin/cde.ksh
30 10 * * * /home/production/bin/put.ksh
00 01 * * * /home/production/bin/lik.sh

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

displaying/ counting lines

I have a file called xx with the env redirected into it 5 times: env >> xx env >> xx env >> xx env >> xx env >> xx I have to read an input file (here: xx) and look for occurrences of the current user who is executing this script. Once finding an occurrence of the username I have to take that... (4 Replies)
Discussion started by: aga
4 Replies

2. Shell Programming and Scripting

displaying/ counting lines

I have a file called xx with the env redirected into it 5 times: env >> xx env >> xx env >> xx env >> xx env >> xx I have to read an input file (here: xx) and look for occurrences of the current user who is executing this script. Once finding an occurrence of the username I have to take that... (2 Replies)
Discussion started by: aga
2 Replies

3. UNIX for Dummies Questions & Answers

Displaying specific lines in a file.

I'm trying to figure out how to display a certain line in a text file. I keep getting references to Tail and Head, and I know how these work, but i'm lost on how to find say the third out of the five lines and display only that. I thought maybe grep could help, but that doesn't seem likely. ... (3 Replies)
Discussion started by: MaestroRage
3 Replies

4. Shell Programming and Scripting

Help required in displaying lines exceeding 79 chars along with their line numbers ??

Hi folks, I am looking for a solution to display those lines in any file that contains 80 or more characters along with their corresponding line number in the file. The below script will print the lines with their corresponding line numbers... sed = Sample.cpp | sed 'N;s/\n/\t/;... (8 Replies)
Discussion started by: frozensmilz
8 Replies

5. Shell Programming and Scripting

Displaying number of lines from file

Hi, I am using below command to display the number of line, but its returning no of lines along with file name. But i want only no of line in the variable p. Please help me on this? p=`wc -l "text file"` echo "$p" (6 Replies)
Discussion started by: shivanete
6 Replies

6. Shell Programming and Scripting

Displaying lines of a file where the second field matches a pattern

Howdy. I know this is most likely possible using sed or awk or grep, most likely a combination of them together, but how would one go about running a grep like command on a file where you only try to match your pattern to the second field in a line, space delimited? Example: You are... (3 Replies)
Discussion started by: LordJezoX
3 Replies

7. Homework & Coursework Questions

Displaying specific lines from a CSV file

1. The problem statement, all variables and given/known data: Display from a csv file, birthdays that occur today. If there are no birthdays today, the next one in the year. 2. Relevant commands, code, scripts, algorithms: The csv file is ordered from older to younger (ie. the most recent... (8 Replies)
Discussion started by: Adzi
8 Replies

8. Shell Programming and Scripting

Displaying lines of a file which have the highest number?

Hello Wondering if anybody may be able to advise on how I can filter the contents of the following file: <object_name>-<version> <Instance> GM_GUI_code.fmb-4 1 GM_GUI_code.fmb-5 1 GM_GUI_code.fmx-4 ... (7 Replies)
Discussion started by: Glyn_Mo
7 Replies

9. Shell Programming and Scripting

displaying multiple lines using AWk

say I'm doing awk 'NR==534' Is there a way to display 534 535 536 537? without appending to a variable? per line? maybe an easier way with a different command? My first impression was NR==534-537 but that would be too easy :P (2 Replies)
Discussion started by: puttster
2 Replies

10. Shell Programming and Scripting

Displaying all the lines starting with some keyword

consider the contents of a file has many stuff including few stuff that i need.. so i perfromed the below function cat filename | grep "ALTER TABLE" its output is as shown below . . . . . SET @sql:=CONCAT('ALTER TABLE RecordMixProfile AUTO_INCREMENT=', @maxId) ; SET... (14 Replies)
Discussion started by: vivek d r
14 Replies
HOME(8) 						      System Manager's Manual							   HOME(8)

NAME
home, 40meg, 80meg, personalize, update, Disclabel - administration for local file systems SYNOPSIS
gnot/home gnot/personalize gnot/update magnum/home magnum/personalize magnum/update pc/40meg pc/80meg pc/personalize pc/update nextstation/home nextstation/update DESCRIPTION
These programs help maintain a file system on a local disk for a private machine. Home partitions a disk, copies the appropriate kernel to the disk, and makes a new file system on the disk. To do this, it overwrites the vendor-supplied software on the disk with a copy of Plan 9. 40meg, 80meg, and 100meg configure disks and make file systems for disks of the appropriate size. Update copies the current kernel to the disk and updates files on the local file system. It only updates those files put there by the home program. Personalize removes the contents of the /usr directory on the local disk and copies a minimal set of files for the user who runs the com- mand. The file /rc/bin/nextstation/Disclabel, despite its name, is not an rc(1) script. It contains the second stage bootstrap program for Nextstations booting from local disk. Before booting a Plan 9 Nextstation from disk, it should be installed in the partition /dev/hd1label; this is normally done by nexstation/home. FILES
/lib/proto/portproto Mkfs prototype files for magnum/home, magnum/update, gnot/home, and gnot/update. /lib/proto/386proto Mkfs prototype files for pc/40meg, pc/80meg, and pc/update. SOURCE
/rc/bin/gnot/* /rc/bin/magnum/* /rc/bin/pc/* /rc/bin/nextstation/* SEE ALSO
kfs(4), mkfs(8), prep(8), wren(3) ``Installing the Plan 9 Distribution''. HOME(8)
All times are GMT -4. The time now is 01:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy