cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

xp_cmdshell; does it work from linux?

Former Member
10,302

Does xp_cmdshell access the Linux shell as well as the windows shell as appropriate depending on the base system? If so which linux shell is accessed and does this require configuration? I am attempting to run a privileged linux command (requiring SUDO) from a SQL Anywhere script running in ISQL. I am attempting to determine which version of askpass is required for the SUDO -A environment variable. OpenSuSE 12.3 installs the x11 version by default; it does not work or I have configured it improperly. I am running Gnome and there is a gnome (and kde3 I believe I do not need) version of askpass that could work; I will be trying the gnome version next.

I have read the DCX help and there was no discussion of specific linux actions.

Thanks

View Entire Topic
Former Member

More research led to an very elegant and workable answer. In xp-cmdshell (I use OpenSuse 12.3 and Gnome) I run the command "gnome-terminal -e {script}.sh" (no quotes). In the .sh file I place the command I want to execute on one line and the command "exit" in a separate line at the end of the script. The result is execution like windows with a terminal console window opening to run the command and closing when done. Leaving out the exit command allows the window to remain open to resolve errors. It requires the user to manually exit the terminal console window.

Thanks Mark for heading me down a path that would succeed.

thomas_duemesnil
Participant

Keep in mind that as long as the Shell is not finished you have bound a Database Worker with waiting for that task to finish.

Former Member
0 Likes

This is part of a batch load application and not an online transaction -- this should not be an issue.

Former Member
0 Likes

And generally I run with the exit command in the file so it will not hang. I only run without the exit when testing the command in the file and I want to see the result in the terminal window.