# Load or execute macro in root 6.26.00

**URL:** <https://root-forum.cern.ch/t/load-or-execute-macro-in-root-6-26-00/52189>\
**Category:** Newbie\
**Tags:** root\
**Created:** [November 1, 2022, 3:51pm UTC](https://root-forum.cern.ch/t/load-or-execute-macro-in-root-6-26-00/52189 "2022-11-01T15:51:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NgJunKai](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ngjunkai/32/30046_2.png) [@NgJunKai](https://root-forum.cern.ch/u/NgJunKai)\
**Post date:** [November 1, 2022, 3:51pm UTC](https://root-forum.cern.ch/t/load-or-execute-macro-in-root-6-26-00/52189/1 "2022-11-01T15:51:19Z")

</div>

I used to issue `root .x macro.C` or `root .L macro.C`(I was using v6.24, under conda environment in centos7).  
The same command seems to be not available in v6.26.00. the root help menu shows:

```auto
OPTIONS:
  -b Run in batch mode without graphics
  -x Exit on exceptions
  -e Execute the command passed between single quotes
  -n Do not execute logon and logoff macros as specified in .rootrc
  -t Enable thread-safety and implicit multi-threading (IMT)
  -q Exit after processing command line macro files
  -l Do not show the ROOT banner
  -a Show the ROOT splash screen
  -config print ./configure options
  -h, -?, --help Show summary of options
  --version Show the ROOT version
  --notebook Execute ROOT notebook
  --web Display graphics in a default web browser
  --web=<browser> Display graphics in specified web browser
  [dir] if dir is a valid directory cd to it before executing
  [file:data.root] Open the ROOT file data.root
  [file1.C...fileN.C] Execute the the ROOT macro file1.C ... fileN.C

```

Is the new root command does not differentiate between ‘load’ and ‘run’ ?  
so everytime we open the macro, the macro always get executed ?

* * *

\_ROOT Version:6.26.00  
\_Platform:conda (in Ubuntu 20.04, WSL)  
\_Compiler:GCC 10.4.0

* * *

---

<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:** [November 1, 2022, 3:54pm UTC](https://root-forum.cern.ch/t/load-or-execute-macro-in-root-6-26-00/52189/2 "2022-11-01T15:54:15Z")

</div>

```auto
void macro () {
   printf("Macro.C\n");
}

```

```auto
% root .x macro.C
Warning in <TApplication::GetOptions>: macro .x not found
root: unrecognized option '.x'
Try 'root --help' for more information.

% root macro.C   
   ------------------------------------------------------------------
  | Welcome to ROOT 6.27/01 https://root.cern |
  | (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosx64 on Nov 01 2022, 13:41:29 |
  | From heads/arrow-on-axis@v6-25-02-2657-gcf85b10bb6 |
  | With Apple clang version 14.0.0 (clang-1400.0.29.102) |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

root [0] 
Processing macro.C...
Macro.C
root [1] 

```

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [November 1, 2022, 5:41pm UTC](https://root-forum.cern.ch/t/load-or-execute-macro-in-root-6-26-00/52189/3 "2022-11-01T17:41:24Z")

</div>

For the .L you can do:

```auto
root -e '.L Macro.C'

```
