In [1]:
sh:
echo I am in directory `pwd`
echo I am the second line


I am in directory /Users/bpeng1/sos/development/examples
I am the second line

In [2]:
sh('''\
echo I am in directory `pwd`
echo I am the second line
''')


I am in directory /Users/bpeng1/sos/development/examples
I am the second line

In [3]:
sh:
echo I am in directory `pwd`
echo I am the second line
python:
print('This is Python')


I am in directory /Users/bpeng1/sos/development/examples
I am the second line
This is Python

In [4]:
sh:
  echo I am in directory `pwd`
  echo I am the second line
python:
  print('This is Python')


I am in directory /Users/bpeng1/sos/development/examples
I am the second line
This is Python

In [5]:
sh: workdir='..'
  echo I am in directory `pwd`
  echo I am the second line


I am in directory /Users/bpeng1/sos/development
I am the second line

In [6]:
number = 6
sh:
  echo I see number {number}


I see number {number}

In [7]:
number = 6
sh: expand=True
  echo I see number {number**2}


I see number 36

In [8]:
sh(f'''
  echo I see number {number**2}
''')


I see number 36

In [9]:
number = 6
R: expand=True
   if ({number} > 1) {{
       cat("The number {number} is greater than 1\n")
   }}


The number 6 is greater than 1

In [10]:
number = 6
R: expand='${ }'
   if (${number} > 1) {
       cat("The number {number} is greater than 1\n")
   }


The number {number} is greater than 1

In [ ]: