[SERVER-6567] is it possible to shell out to the OS from the mongo shell? Created: 23/Jul/12 Updated: 15/Aug/12 Resolved: 23/Jul/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin |
| Affects Version/s: | 2.0.4 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Minor - P4 |
| Reporter: | George Nikopoulos | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux red hat 5.6 |
||
| Participants: |
| Description |
|
Using the mongo shell as admin, but finding it anoying to heave to shell out of the mongo shell, ino the OS, and then back in and go through the authentication again. Is there any command similar to ( ! or "host" in sqlplus from oracle) to allow for this? Thank you |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 23/Jul/12 ] | |||||
|
Yes:
BTW. ctrl-z was broken in 2.0.x | |||||
| Comment by George Nikopoulos [ 23/Jul/12 ] | |||||
|
thank you, it works. One more request on this topic. Is it possible to pass a parameter to the command? ex: run("ls") works fine, but I am getting those erorrs : "shell: started program ls -ltr | |||||
| Comment by Scott Hernandez (Inactive) [ 23/Jul/12 ] | |||||
|
Yes, there is a run("path/to/executable") function which shells out:
As you can see, this will just run a command. There is no way to go to get the output nor to have an interactive os shell/prompt. You can use normal shell stuff like pressing Ctrl-Z to pause and "fg" to resume for example on linux. |