Luca Luca - 1 year ago 139
Linux Question

Linux, BASH launch command with special char

I must implement a deploy script that launches command by special char from specific user.

The command that I must launch is:

cd /path
. ./

I am trying to launch the command with this syntax:

su - USER -s /bin/bash -c 'cd /PATH/ && . ./'
su - USER -s /bin/bash -c 'cd /PATH/ && ant clean all'

But I've got a problem with
. ./

Answer Source

In order to configure the environment for your subsequent ant command, you have to include the ". ./" inside your second call. Both calls result in independent bash processes that dont share their specific environment.

try this:

su - USER -s /bin/bash -c 'cd /PATH/ && . ./ && ant clean all'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download