[ale] windoze scripts to linux scripts

Geoffrey Myers lists at serioustechnology.com
Fri May 27 14:22:12 EDT 2011


Michael Trausch wrote:
> I thought the goal was to ensure that the full path was listed. Using 
> find like that only works if you specify the whole path in $DIR, whereas 
> realpath will always return the full path. I use realpath quite a bit 
> for other things which is why using it came to mind.

The original solution was:

dir /s /b c:\bin

That in and of itself is specifying the whole path.  So how is:

find /bin -print

Any different?


> 
> --
> Sent from my phone... a G2 running CM7 nightlies!
> 
> On May 27, 2011 1:59 PM, "Geoffrey Myers" <lists at serioustechnology.com 
> <mailto:lists at serioustechnology.com>> wrote:
>  > I still don't understand what is wrong with a simple find:
>  >
>  > find $DIR -print
>  >
>  > Clean, and easy. No different the the OP's windows solution.
>  >
>  > James Sumners wrote:
>  >> Here's a bash script you can use without having to install any extra
>  >> packages. Note that 1) it is slow and 2) you run it like so:
>  >> `listpath.sh .`
>  >>
>  >> #!/bin/bash
>  >>
>  >> IFS=$'\n'
>  >>
>  >> for f in $(find ${1} -type f); do
>  >> DIR=$(dirname $(readlink -f ${f}))
>  >> NAME=$(basename ${f})
>  >>
>  >> echo "${DIR}/${NAME}"
>  >> done
>  >>
>  >> On Fri, May 27, 2011 at 12:23 PM, Michael Trausch <mike at trausch.us 
> <mailto:mike at trausch.us>> wrote:
>  >>> find . -print0 | xargs -0 realpath
>  >>>
>  >>> You might have to install the realpath package.
>  >>
>  >>
>  >
>  >
>  > --
>  > Until later, Geoffrey
>  >
>  > "I predict future happiness for America if they can prevent
>  > the government from wasting the labors of the people under
>  > the pretense of taking care of them."
>  > - Thomas Jefferson
>  > _______________________________________________
>  > Ale mailing list
>  > Ale at ale.org <mailto:Ale at ale.org>
>  > http://mail.ale.org/mailman/listinfo/ale
>  > See JOBS, ANNOUNCE and SCHOOLS lists at
>  > http://mail.ale.org/mailman/listinfo
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo


-- 
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson


More information about the Ale mailing list