![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Removing last character from each line of file | cjhancock | Shell Programming and Scripting | 17 | 08-29-2008 01:05 AM |
| How to add new line character at the end of a file | DebianJ | UNIX for Dummies Questions & Answers | 5 | 05-07-2008 12:22 PM |
| Deleting end of line $ character in file | bwrynz1 | UNIX for Advanced & Expert Users | 3 | 01-08-2008 09:17 AM |
| delete a line based on first character of the line | borncrazy | UNIX for Dummies Questions & Answers | 2 | 12-06-2005 11:27 AM |
| How would I replace the 9th character of every line in a file? | LordJezo | Shell Programming and Scripting | 5 | 09-01-2004 08:51 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Need to serach if a new line character exists on the last line in a file
I have a file in which I need to search if a new line character exists on the last line in the file. Please let me know how can I achieve it using Unix commands?
|
| Forum Sponsor | ||
|
|
|
|||
|
1. The file is on a Unix OS.
2. Unix Hardware configuration: Sun Microsystems Inc. SunOS 5.9 3. I need to search for end of line character i.e. /n on the last line of this file. Please let me know if you will need more information. |
|
|||
|
2 problems:
a. when the command is executed it specifies "usage" in the result and b. Looks like it retruns a value '0' for both types of files. Please see below: sma2z@ianb1as1 [/apps/prodcopy/export/RW10X] $ --> tail -1 Alert_enuCPU18.0002.exp | od -An -t oC -w1 | tail -1 | grep -c "012" usage: od [-bcCdDfFoOsSvxX] [-] [file] [offset_string] od [-bcCdDfFoOsSvxX] [-t type_string]... [-A address_base] [-j skip] [-N count] [-] [file...] 0 sma2z@ianb1as1 [/apps/prodcopy/export/RW10X] $ --> tail -1 Alert_enuCPU16.0001.exp | od -An -t oC -w1 | tail -1 | grep -c "012" usage: od [-bcCdDfFoOsSvxX] [-] [file] [offset_string] od [-bcCdDfFoOsSvxX] [-t type_string]... [-A address_base] [-j skip] [-N count] [-] [file...] 0 Thanks for looking into my problem. |
|||
| Google The UNIX and Linux Forums |
| Tags |
| solaris |
| Thread Tools | |
| Display Modes | |
|
|