Bhargav Teja
Bhargav Teja

Reputation: 451

Shell file is not invoking from other shell file

I have a.sh and b.sh. I changed shell from bash to ksh. Now it is not invoking b.sh.

a.sh

`#!/bin/ksh
 source /home/ec2-user/env
 abc_job() {
     nohup abc >> $HOME/a.log 2>&1 </dev/null &
 }
 abc_jbo() >> $HOME/a.log
 exit 0`

abc is the binary file of c that invokes b.sh

b.sh

`#!/bin/ksh
    echo "completed b.sh job >> $HOME/b.log
 exit`

Upvotes: 0

Views: 34

Answers (1)

mao
mao

Reputation: 12287

The csh built-in command 'source' has the ksh equivalent '.', in your case:

. /home/ec2-user/env

If execution of /home/ec2-user/env is mandatory you might want to be more defensive and verify that it is present and executable and that it completes successfully.

Upvotes: 1

Related Questions