[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to remove a specific line in a file
From: |
Eka1618 |
Subject: |
How to remove a specific line in a file |
Date: |
Mon, 30 Apr 2007 12:00:30 -0700 (PDT) |
I am currently trying to figure out how to remove a specific line in a file.
So far I've only been able to come up with Ideas such as removing blank
lines, duplicate lines, or a number of line that are one right after
another. I think that I should be using the commands grep, cat, and rm along
with pipes to somhow make this work.
Here is some code that I've started so far:
first script i though of:
#!/bin/sh
mtmp='wc -l mylock | awk '{print $1}''
ntmp='expr $mtmp - 1'
tail -n $netmp mylock
second idea:
cat mylock | grep 'pid' | rm -r
I am new to the BASH language, and so If there are any good websites that I
can reference please let me know!
Thank You!
~EKA~
--
View this message in context:
http://www.nabble.com/How-to-remove-a-specific-line-in-a-file-tf3671302.html#a10258735
Sent from the Gnu - Bash mailing list archive at Nabble.com.
- How to remove a specific line in a file,
Eka1618 <=