![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to read record by record from a file in unix | raoscb | UNIX for Dummies Questions & Answers | 1 | 05-16-2008 06:30 AM |
| Delete particular value from file using 'sed' | sai_nj | Shell Programming and Scripting | 2 | 03-31-2008 12:38 AM |
| Script to search a bad record in a file then put the record in the bad file | shilendrajadon | UNIX for Advanced & Expert Users | 1 | 12-28-2007 10:00 AM |
| splitting a record and adding a record to a file | rsolap | Shell Programming and Scripting | 1 | 08-13-2007 01:58 PM |
| command to remove last record on file | mheinen | UNIX for Dummies Questions & Answers | 4 | 01-09-2007 04:39 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Usiung last record of file using 'sed' command
Hi,
In my Scripts,i need to read record from a file and after reading I need to delete that record,as I need to run the script in a loop for no of records in file.( I am using While-do command for that).But my problem is while deleting record using command"`cat ${TEST_FILE}|sed '$d' > ${TEST_FILE}`",first time it is deleting record properly but in second reu(in while loop),it is deleting all records at same time. Please suggest some solution. Thanks in advance |
|
||||
|
Delete last record from file using "Sed"
Hi,
In my Scripts,i need to read record from a file and after reading I need to delete that record,as I need to run the script in a loop for no of records in file.( I am using While-do command for that).But my problem is while deleting record using command"`cat ${TEST_FILE}|sed '$d' > ${TEST_FILE}`",first time it is deleting record properly but in second reu(in while loop),it is deleting all records at same time. Please suggest some solution. Thanks in advance |
|
||||
|
Reply to query "delete last record using sed"
I think my qrery is doing same this,insted of writing output (after deletion of record from file) to new file and then moving the new file again into same (original file) I am over writing writing in the same file.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|