Luca Luca - 1 month ago 5x
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
. ./


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'