Skip to main content

Here’s a little script, call it mygit, that works for me on Ubuntu Linux:

#!/usr/bin/bash
git ${@}

> mygit commit -m "Two words."
[commit works; commit message is "Two words."]

It doesn’t work on z/OS, though:

#!/rsusr/ported/bin/bash
git ${@}

> mygit commit -m "Two words."
error: pathspec 'words.' did not match any file(s) known to git.

It looks like the array of input parameters is being passed to the git command as individual words, not as a proper array. How do I make this work?

Here’s a little script, call it mygit, that works for me on Ubuntu Linux:

#!/usr/bin/bash
git ${@}

> mygit commit -m "Two words."
[commit works; commit message is "Two words."]

It doesn’t work on z/OS, though:

#!/rsusr/ported/bin/bash
git ${@}

> mygit commit -m "Two words."
error: pathspec 'words.' did not match any file(s) known to git.

It looks like the array of input parameters is being passed to the git command as individual words, not as a proper array. How do I make this work?

Hi Tony,

I have no idea, why it works on Ubuntu. Cause it doesn’t work on CentOS. And it is normal bash behavior:
Link1
Link2

Use this script:

#!/rsusr/ported/bin/bash
git "${@}"

Thanks,
Tatyana


Hi Tony,

I have no idea, why it works on Ubuntu. Cause it doesn’t work on CentOS. And it is normal bash behavior:
Link1
Link2

Use this script:

#!/rsusr/ported/bin/bash
git "${@}"

Thanks,
Tatyana

Of course. How intuitive.

Thanks, Tatyana.