How to execute a script with out giving x permission to the file?
---------- Post updated at 01:06 PM ---------- Previous update was at 01:05 PM ----------
suppose your file name is abcd.sh
sh abcd.sh
You can debug the script with additing -x
sh -x abcd.sh
. script.sh
Jus give space between dot and script name
Not quote. A dot runs the given file in the context of the current shell. Think of it like an #include in C/C++. If the script modifies the environment, you'll have the effects in your current shell, which not always is what you want.
I am aware of all the above possibilities. i am looking for a particular command which will help to run the script with out execute permission to the file.
I forgot that command.
Example, Some files like .bashrc in home directory of a normal user will use that command.
Are you looking for source command ?
Yes. Now I remembered.
Thanks xoops. That is the command I am looking for.
---------- Post updated at 11:29 AM ---------- Previous update was at 11:27 AM ----------
Yes. Thanks xoops.
Source is the command i am looking for.