[Discuss] SED question

Nathan Meyers nmeyers at javalinux.net
Tue Oct 4 11:45:22 EDT 2011


On Tue, Oct 04, 2011 at 11:35:00AM -0400, Chandler, Scott wrote:
> I've got a script running a sed command that I need help interpreting. The line is "sed '$d' file1.txt > file2.txt".
> 
> I understand that sed '$d' file1.txt removes the last line from the file but will the resultant file (file2.txt) contain only the last line from file1.txt or will it contain everything *except* the last line from file1.txt?

Hello Scott,

The output of sed (what ends up in file2.txt) is the result of applying
the edit - in this case, it will be the input file contents with the
last line removed.

Nathan


> 
> Thanks,
> Scott
> 
> 
> _______________________________________________
> Discuss mailing list
> Discuss at blu.org
> http://lists.blu.org/mailman/listinfo/discuss
> 



More information about the Discuss mailing list