Command::new: run files that don't have x permission (executable bit)

Good morning,

I have an application which has some code that runs a shell script that doesn't have an executable bit. I don't want to make the user make it executable because some programs remove that executable bit.

Is there any way to do it without that? Or do I have to set the executable bit via the script?

Thanks.

You don't need x bit if you will pass the script directly to the shell: bash <your_script>. (assuming script is in bash).


Didn't you confused the forum? This is a forum for the Rust programming language, but your question doesn't have anything specific to Rust.

By the way, that question could've need easily answered by ChatGPT.

1 Like