title: run command in custom shell instance inside bash script
body: <p>I have a script:
  script</p>
  
  <pre><code>#!/bin/bash
  read -n password
  if [[ $password = $correct-password ]]; then
  custom shell
  else
  exit
  fi
  </code></pre>
  
  <p>Then, I have another script:</p>
  
  <pre><code>#!/bin/bash
  echo password | ./script
  commands
  </code></pre>
  
  <p>I want the commands in the second script to run in my custom shell not bash but they just run in bash. I can't do any changes in my first script.
  Instead of echo I have tried redirect password from file and here document "&lt;&lt;" still yeilds the same result.</p>