# Macro in directory with a complicated name

**URL:** <https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015>\
**Category:** Newbie\
**Created:** [May 18, 2022, 3:07pm UTC](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015 "2022-05-18T15:07:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![surrutiaquir](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@surrutiaquir](https://root-forum.cern.ch/u/surrutiaquir)\
**Post date:** [May 18, 2022, 3:07pm UTC](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015/1 "2022-05-18T15:07:14Z")

</div>

If I have a very simple macro named `helloscript.cc` in `/Users/surrutiaquir/Downloads`,

```auto
void helloscript()
{
  cout << "hello world!" << endl;
}

```

I’m able to run it smoothly:

```auto
$ root -l -b helloscript.cc
root [0] 
Processing helloscript.cc...
hello world!

```

However, if I move the file to a directory with a more complicated name (`/Users/surrutiaquir/Dropbox/HEP/[Research] My Papers/[PUC] IDM at the LHC (inconcluso)/nyx`) I get the following error:

```auto
root -l -b helloscript.cc
root [0]
Processing helloscript.cc...
Error in <TApplication::ExecuteFile>: macro helloscript.cc not found in path .:/Users/surrutiaquir/Software/Python/envs/root6/macros

```

What might be the reason? Thanks a lot for your input.

_ROOT Version:_ 6.26/02  
_Platform:_ macosx64  
_Compiler:_ clang

* * *

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 18, 2022, 3:39pm UTC](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015/2 "2022-05-18T15:39:42Z")

</div>

> [@surrutiaquir](#):
>
> However, if I move the file to a directory with a more complicated name

Did you `cd` to that folder before running root ?

---

<div class="post-metadata">

**Author:** ![surrutiaquir](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@surrutiaquir](https://root-forum.cern.ch/u/surrutiaquir)\
**Post date:** [May 18, 2022, 3:44pm UTC](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015/3 "2022-05-18T15:44:43Z")

</div>

Yes, I did

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 18, 2022, 4:03pm UTC](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015/4 "2022-05-18T16:03:11Z")

</div>

That’s weird… can you do:

1. `cd the_directory_with_complicated_name`
2. `pwd`
3. `ls *.cc`

?

---

<div class="post-metadata">

**Author:** ![surrutiaquir](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@surrutiaquir](https://root-forum.cern.ch/u/surrutiaquir)\
**Post date:** [May 18, 2022, 5:50pm UTC](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015/5 "2022-05-18T17:50:40Z")

</div>

This is odd. If I do

```auto
$ cd /Users/surrutiaquir/Dropbox/HEP/\[Research\]\ My\ Papers/\[PUC\]\ IDM\ at\ the\ LHC\ \(inconcluso\)/nyx
$ pwd
/Users/surrutiaquir/Dropbox/HEP/[Research] My Papers/[PUC] IDM at the LHC (inconcluso)/nyx
$ ls *.cc
helloscript.cc

```

everything works, but if I run

```auto
$ cd /Users/surrutiaquir/Dropbox/HEP/[Research] My Papers/[PUC] IDM at the LHC (inconcluso)/nyx
-bash: syntax error near unexpected token `('

```

I get that error message.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 19, 2022, 6:19am UTC](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015/6 "2022-05-19T06:19:12Z")

</div>

Yes, the 2nd `cd` does not work because the spaces are not escaped with `\`

---

<div class="post-metadata">

**Author:** ![surrutiaquir](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@surrutiaquir](https://root-forum.cern.ch/u/surrutiaquir)\
**Post date:** [May 19, 2022, 1:09pm UTC](https://root-forum.cern.ch/t/macro-in-directory-with-a-complicated-name/50015/7 "2022-05-19T13:09:01Z")

</div>

Thanks a lot for the clarification!
