diff --git a/getting_started/08_scripts.md b/getting_started/08_scripts.md
index 2f506ed70aab078b0ad7e9a4af3e7e29a9a59aa7..e88da22bd6878bcd219e07b687c90ce7a0f27e4e 100644
--- a/getting_started/08_scripts.md
+++ b/getting_started/08_scripts.md
@@ -93,7 +93,7 @@ fsldirpath = os.getenv('FSLDIR')
 commands = commands.format(t1 = 't1.nii.gz', t1_mask = 't1_mask', t2 = 't2', t2_masked = 't2_masked', fsldir = fsldirpath)
 
 sout=[]
-for cmd in commands.split('\n'):
+for cmd in commands.splitlines():
     if cmd:   # avoids empty strings getting passed to sp.run()
         print('Running command: ', cmd)
         spobj = sp.run(shlex.split(cmd), stdout = sp.PIPE)