[racket] running racket from the command line
(for ([dir (map path->string (directory-list))])
(define newdir (string-replace dir " " "_"))
(unless (equal? dir newdir)
(rename-file-or-directory dir newdir #f)))
or
for dir in *; do
newdir=`echo "$dir" | tr " " _` ;
if [ "$dir" != "$newdir" ] ; then mv -i "$dir" "$newdir" ; fi ;
done
Feel free to delete newlines from either bit of code until it becomes a
one-liner :)
Ryan
On 10/21/2013 02:23 PM, Matthew Johnson wrote:
> Thanks - good tip. I don't suppose there some awesome one liner that
> does this for all working directory paths?
>
> On 22/10/2013, at 5:21 AM, Greg Hendershott <greghendershott at gmail.com> wrote:
>
>> Early on using Racket, like you I had some trouble or other quoting. I
>> adopted the perhaps dubious habit of, right after installing a new
>> version, renaming to e.g. /Applications/Racket_v5.3.6" -- i.e. " " ->
>> "_".
>>
>> On Mon, Oct 21, 2013 at 4:50 AM, Matthew Johnson <mcooganj at gmail.com> wrote:
>>> Thanks very much. Working well now.
>>>
>>> For those that find this, a trap for young players is that you must
>>> quote paths with spaces in them, else you will lose everything you
>>> depend upon (even the command 'ls').
>>>
>>> So it is
>>>
>>> Export PATH="/Applications/Racket v5.3.6/bin":$PATH
>>>
>>> mj
>>>
>>> On 21/10/2013, at 7:30 PM, Norman Gray <norman at astro.gla.ac.uk> wrote:
>>>
>>>>
>>>> Matt, hello.
>>>>
>>>> On 2013 Oct 21, at 08:59, Matthew Johnson <mcooganj at gmail.com> wrote:
>>>>
>>>>> I just downloaded the Racket binaries and installed them.
>>>>
>>>> Ah, but where have you installed them?
>>>>
>>>>> I have been able
>>>>> to fire up DrRacket, however given that i prefer vim i was hoping to run
>>>>> racket from the command line.
>>>>>
>>>>> I've tried
>>>>>
>>>>> $ racket and $ which racket
>>>>
>>>> I take it, then, that you're on a unix. On OS X for example, the relevant bin/ directory is located in the same directory as DrRacket.app, and so that's the directory (.../Racket\ v5.3.6/bin) that has to be (explicitly) added to your path. I don't know the layout of the various Linux distributions, but I imagine there's a broadly similar layout there.
>>>>
>>>> Best wishes,
>>>>
>>>> Norman
>>>>
>>>>
>>>> --
>>>> Norman Gray : http://nxg.me.uk
>>>> SUPA School of Physics and Astronomy, University of Glasgow, UK
>>>
>>> ____________________
>>> Racket Users list:
>>> http://lists.racket-lang.org/users
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
>