[U-Boot-Users] script to delete all trailing space

Aubrey Li aubrey.adi at gmail.com
Mon Mar 12 15:06:43 CET 2007


On 3/12/07, Peter Pearse <peter.pearse at arm.com> wrote:
> >
> > You are wrong. If the name of the function in the script is
> > the same as the external application, the function will be
> > executed, NOT the external application.
> >
> > Best Regards,
> > -Aubrey
>
> But it might be less confusing if the script function had a distinct and
> unique name.....
> e.g. ali_strip
>

Sure, re-post the script.
----------------------------------------------------------------
#!/bin/sh
# delete all the trailing white space characters (SPACE and
# TAB) at the end of all the lines in a file
# Usage:
#|______./strip-trailing-space.sh files
#
# The script:
#
#  Copyright (C) 2007 Aubrey Li, All Rights Reserved.
#
#  This script is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License version 2 as
#  published by the Free Software Foundation.
ali_strip()
{
|_______cp $1 $1~
|_______sed -e 's/\s\+$//' < $1~ > $1
}

for i in $*
do ali_strip $i
done
---------------------------------------------------------------------

Best Regards,
-Aubrey




More information about the U-Boot mailing list