Questions tagged [interactive-shell]

74 questions
3
votes
1 answer

Check if Swift program is outputting to terminal

How can I check from my Swift script whether or not I am outputting to a terminal? In a bash or zsh script, for example, this can be accomplished with the -t 1 conditional expression to check if file descriptor 1 (stdout) is open and associated with…
hawk
  • 2,655
  • 2
  • 16
  • 11
2
votes
0 answers

I can't Create interactive shell using reverse shell to execute python files

I am trying to execute the python file using reverse shell, where it should ask the input remotely in server while executing 1st.py(which is in clients directory) but instead of that, it is asking in clients terminal. I am unable to send the(1st.py)…
2
votes
1 answer

How to pass positional arguments to an interactive bash session

I wanted to start an interactive bash shell like this : bash (...some options) 1 2 3 so that in the shell session, I have $1=1, ... I didn't find any options to achieve the effect. I tried this, thought it might work : bash -c bash _ 1 2 3 but it…
Philippe
  • 20,025
  • 2
  • 23
  • 32
2
votes
1 answer

Can PHP's interactive mode run code in a namespace?

While in PHP's interactive mode, I tried the following: php > namespace MyNamespace; php > class Throwable {} This results in a fatal error: PHP Fatal error: Cannot declare class Throwable, because the name is already in use in php shell code on…
Leo Galleguillos
  • 2,429
  • 3
  • 25
  • 43
2
votes
1 answer

Different behavior of go exec for different shell commands

I'm trying to use different shell commands for a console go application, and for some reason the behavior is different for the following interactive shells. This code prints result of a mongoDB query: cmd := exec.Command("sh", "-c", "mongo --quiet…
silent-box
  • 1,649
  • 3
  • 21
  • 40
2
votes
1 answer

Print pyObjC version installed?

I've recently started programming "Objective C" in python using the excellent pyObjC extension. I'm using macOS High Sierra (10.13.4) with apple's stock python 2.7.10 installation. That part was easy to find out using an interactive python…
jjabba
  • 494
  • 3
  • 16
2
votes
1 answer

Opening Interactive PowerShell GUI script for other logged on users

Hello Folks, I have a powershell MTA (GUI script using winForms), which works well, lets take the script name to be "ENDUserMTA.ps1" which does invoke certain commands and does something which really needs admin rights. this works fine…
2
votes
3 answers

PHP interactive shell, auto echo and a new line

Greetings fellow programmers! Is there a way to get PHPs interactive shell, php -a, to behave more like Rails console or the console in Chrome? I have looked through the flags for the php-command, but no dice. What I get: php > $a = 0; php > $a; php…
Emil
  • 1,035
  • 3
  • 10
  • 19
2
votes
1 answer

Infer generic types on scala shell

Is it possible to use the scala shell to infer the type of a generic function? I was trying to undestand the type of the function Future.traverse (scala 2.10). The complete generic type is def traverse[A, B, M[_] <: TraversableOnce[_]](in:…
Rafael S. Calsaverini
  • 13,582
  • 19
  • 75
  • 132
2
votes
1 answer

MongoDB shell history doesn't remember 'authentications'

The command line history of the interactive shell for MongoDB (2.0.4 on MacOSX Lion) doesn't work when I use commands on a collection called 'authentications', but it works fine for everything else, it seems. $ mongo mydb MongoDB shell version:…
1
vote
0 answers

Why can't I take input in neovim shell emulator in c++?

I just learned neovim and am planning to switch to neovim but I want to make it more like an ide. I know it's a text editor but it has a built-in shell emulator which is cool for seeing code output. but it's not interactive. My code: #include…
MSN
  • 11
  • 3
1
vote
1 answer

Extending the Python interactive shell

I'd like to extend the Python interactive shell to allow execution of non-python specific statements or commands. The idea being, if you type something on the prompt that would raise a NameError what you typed could be parsed for known external…
tMC
  • 18,105
  • 14
  • 62
  • 98
1
vote
0 answers

How to properly write an interactive shell program which can exploit bash's autocompletion mechanism

(Please, help me adjust title and tags.) When I run connmanctl I get a different prompt, enrico:~$ connmanctl connmanctl> and different commands are available, like services, technologies, connect, ... I'd like to know how this thing works. I know…
Enlico
  • 23,259
  • 6
  • 48
  • 102
1
vote
1 answer

How to write a shell script(any shell languages) that interacts with a program and passes arguments?

#include using namespace std; int main(void){ int number = 0; cout << "Please enter a number: "; cin >> number ; cout << "the number you enter is " << number << endl; return 0;} This is my program that takes in an argument…
user10435053
1
vote
1 answer

A Telegram bot to control a Raspberry Pi through an interactive shell

I am trying to write the program for a Telegram bot to control my Raspberry Pi, so that every message I send the bot shall be interpreted as a shell command [1][2]. The Raspberry Pi is a version 2 model B and runs Arch Linux ARM. The program is…