The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux
.
google unix.com



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command similar to "touch" for modify File size sriharshareddyk UNIX for Advanced & Expert Users 3 11-15-2007 01:43 AM
Deleting all content in a file from command line kingdbag UNIX for Dummies Questions & Answers 2 07-20-2006 07:00 PM
Command similar to doskey halel UNIX for Dummies Questions & Answers 4 05-16-2006 07:49 AM
is there a content type command? aqh2 UNIX for Dummies Questions & Answers 3 11-19-2005 10:14 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-06-2007
lunchtime lunchtime is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 8
Command that prints content of line5, or similar?

Hello all;

I've been having trouble completing a script (bash) because I can't get past the issue of finding a line in a file. For example, I have a file like this:

ddmmmyyyy Lon Lat
24may2003 -100.0 24.1
25may2003 -100.1 24.0
28may2003 -99.5 23.2
....etc
05jun2003 -97.0 22.7
EOF

I'm making a loop, and I need a way to call a line number without specifying what the line contains (i.e., grep doesn't work). Here's what I had in mind:

n=2
While (something that makes the loop infinite); do
day=`command line${n} word1


if
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0