2

I work with ant and bash script. I want to calling bash script from ant . I have script

        <exec executable="echo">
           <arg value=" 1... "/>
        </exec>

it is works fine, but this code not

        <exec executable="cd ">
           <arg value="/home"/>
        </exec>

Why does't work "cd" command ? Can anybody help me?

mindia
  • 6,991
  • 4
  • 22
  • 20

1 Answers1

8

you cannot "execute" cd from ant. cd is not an executable. cd is a shell builtin.

if you are trying to change the current working directory then you can use the dir attribute of the exec task.

see also: Change working directory in ant junit task

Community
  • 1
  • 1
Lesmana
  • 25,663
  • 9
  • 82
  • 87