Questions tagged [interactive]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

pdf with form and send mail button that does not work in gnome

I have this pdf form to be filled anytime I need an additional and temporary worker in my restaurant (for example, an additional waiter). The PDF has been created by the government working agency and ...
2
votes
1answer
34 views

PasswordAuthentication=no flag does not work on one strange host

On my source REDHAT Linux 7 host i fire this command to never prompt for password and passwordless login ssh -i /app/axmw/ssh_keys/id_rsa -o PasswordAuthentication=no root@<target-host> -vvv ...
0
votes
1answer
16 views

Opening an interactive terminal from ranger

Let's say I want to open xfce4-terminal from ranger with a keybind, like map XX shell myterm Is it possible? How?
0
votes
1answer
30 views

Enter subdirectory if current directory is empty

There is one thing that prevents me to discard my GUI-file manager for bash: Bash does not tab-complete to the only subdirectory in an empty directory. $ ls .. // is not displayed, when cmd is ...
6
votes
2answers
627 views

Is possible to define a bash script to run interactively by default?

I have written some scripts and stored them in my ~/bin folder. I'm already able to run them just by calling their title during a shell session. However, they aren't running interactively (I mean, my ~...
0
votes
1answer
27 views

Is it possible to begin a sudo interactive session and also provide an initial command?

A lot of my workflow involves using a sudo interactive session (sudo -i) as a service user that is able to run certain things that my personal username can't. When I do this, I like to preserve my PS1 ...
0
votes
1answer
125 views

Interactive bash script: Prefix all lines with a string

I want to create an interactive CLI in bash. Similar to the way bash prefixes every line with user@host:~$, I would like to prefix every line with foobar>. This functionality can be seen in CLI ...
0
votes
0answers
43 views

Executing a Program with input

I would like to be able to run a program and then feed that program some information all in one line on startup. Suppose I am in the working directory of the executable (sage), I can run ./sage -c "...
0
votes
0answers
34 views

sudo: limit interactive shells?

I have a third-party application that runs on Linux. The application runs as a specific (non-root) account and provides a quite complicated environment to that user. Without an interactive shell as ...
0
votes
0answers
31 views

Filter by default

I'd like to configure my interactive shell (e.g. bash), so that by default all command output will be piped to some filter, e.g. less. i.e., if I type # make it will automatically be interpreted as ...
1
vote
1answer
658 views

Opening interactive python shell after running python script in background

python3 -i test.py opens an interactive python shell after running test.py. However, if I try to run it in the background with python3 -i test.py & the job stops automatically with a ^C and shows ...
1
vote
2answers
77 views

sh: is there a command to interactively edit the PWD?

I'm looking for a command that invokes readline or similar, primed with the current $PWD, to let the user edit the current directory, then cd to the edited value. E.g. > cd ~/a/b/c/d > pwd > ...
0
votes
1answer
54 views

Start new shell with positional parameters

With Python, I can start a session with positional parameters: $ python3 - aa >>> import sys >>> sys.argv[1] 'aa' However it does not seem to be possible with shell: $ sh - aa sh: ...
0
votes
1answer
31 views

Launch interactive app from script

I have an application built in C that uses fgets to read user commands from stdin. I want my embedded linux system to launch this application on startup, and put the user in the terminal of this ...
5
votes
1answer
2k views

Zsh clear scrollback buffer

With Bash CtrlL will clear the screen but not scrollback buffer. In the past I have worked around this by using: tput reset However I have noticed that this command will not clear the scrollback ...
0
votes
0answers
92 views

Zsh disable autofill

Zsh disable autofill If I open a terminal and enter: echo 'hello world' after that if i press e it "suggests" the previous command. How can I disable this? I tried this with no success: autoload ...
1
vote
0answers
124 views

merge commands for line-by-line interactive merging with sdiff, in MacOS unix. Is there a working version?

On MacOS, the sdiff command is described as able to do line-by-line interactive merging, and lists several merge commands for the latest chunk. e.g. sdiff -o mergefile fileleft fileright The single ...
1
vote
1answer
57 views

Confused about determining if a shell script is running interactively

I only want to determine from my POSIX shell script, if it is running interactively, but for some reason, the following function: running_interactively() { printf '%s' ${-} | grep -F i > /dev/...
3
votes
3answers
2k views

How can I make rm -rf ask for confirmation just once at the directory level?

If I use rm -rfi, this asks me every time each file is deleted. If I have a list of rm -rf commands, how can I make it so that the machine asks me for confirmation just once (when trying to delete the ...
0
votes
0answers
203 views

History not working in a Dash i-shell (with Bash as a parent process)

My terminal initializes with Bash. I run dash and enter an interactive Dash shell. I run a few random commands and try to run history only for it to fail. I check if history is enabled and it ...
3
votes
2answers
1k views

Copying files interactively: “cp: overwrite”

I'm trying to figure out what words does the -interactive option of cp accepts as input. For your convenience, here's code that sets up files for experimentation. touch example_file{1..3} mkdir ...
0
votes
0answers
758 views

How can I prompt users while running a playbook?

My needs: Write a playbook which can install apache if the user wants to, while the playbook is running by typing yes or no. apache_prompt.yml hosts: slaves vars_prompt: - name: ...
1
vote
1answer
2k views

interactive SMTP command using telnet via a shell script

I'm trying to access a SMTP remote server thru a remote shell using telnet and a command file command.txt containing command to send to that SMTP server as seen on https://tecadmin.net/ways-to-send-...
-1
votes
2answers
2k views

csh if statement interactive use

Either there's something fishy with my Solaris 10 csh implementation of if statement or I don't get something right (of course the second is very well probable in my case at least) but when I do: % ...
0
votes
1answer
367 views

Run bash subshell with commands as other user and not return to parent shell

As part of my quest to preserve bashrc and vimrc when switching to non-root users, I plan on making some super ugly aliases to switch to other users, immediately execute some commands, and then drop ...
2
votes
1answer
413 views

How to trap INT signal infinitely many times?

I'm piping output of an interactive command (ghci) through sed-based script to add some colors: ghci | colorize.sh where colorize.sh is something like: #!/bin/bash trap '' INT sed '...some pattern.....
2
votes
2answers
835 views

Non-ascii chars are no longer displayed in bash

Updated: This is not a file system problem. I used to be able to enter: $ echo kødpålæg But now bash/zsh change this to: bash$ echo kddddddddplg zsh$ echo k<c3><b8>dp<c3><a5&...
2
votes
1answer
1k views

how to pass value for interactive jar file in shell script

We are using oswatcher in our environment which runs and collects diagnostic information on Redhat linux 5.6 /6.4 versions. This is scheduled under root which runs and collects information on iostat,...
0
votes
1answer
108 views

Can you enumerate all the ways to start an interactive shell?

Bash manual says: An interactive shell is one started without non-option arguments, unless -s is specified, without specifying the -c option, and whose input and output are both connected to ...
1
vote
1answer
56 views

Type Y to Delete, if the script is being executed manually

This is a 2 part question. Scenario: This script is on a cronjob. If a folder does not exist, the system sends us an email that opens a ticket which notifies us that the folder is not available. We ...
0
votes
0answers
103 views

How to write a shell script which adds a wildfly management user without interacting with the user?

When I run add-user script(/opt/wildfly/bin/add-user.sh) , it asks for various inputs 1> a. management user, b. application user 2> Username : 3> Password : 4> Are you sure you want to ...
3
votes
2answers
1k views

Why no such non-interactive version of bashrc?

From what I understanding, a daemon is a background process, but daemon requires unique config file to set the environment variable. E.g. Hadoop daemon require hadoop-env.sh to set environment ...
0
votes
0answers
50 views

How do I copy to clipboard text I cut with Ctrl+U? [duplicate]

In an interactive shell session, how do I copy to clipboard text that was cut with Ctrl+U? Without using the mouse, obviously. Thus making it available for other GUI applications, instead of pastable ...
2
votes
1answer
348 views

Why is Linux allowed to become unresponsive? [closed]

This question Why can a system become unresponsive? comes close. The answer kind of explains what is likely happening, but I just don't understand why this problem hasn't been solved since at least ...
1
vote
0answers
3k views

Bash script calls python script that wants interactively input ( not only arguments )

I have a bash script bash.sh that looks like this: #!/usr/bin/env bash /usr/local/sbin/pythonScript.py firstArgument secondArgument If I call the pythonScript.py from my terminal with the two ...
1
vote
1answer
889 views

Making mysql CLI ask me for a password interactively

I use the following code as part of a much larger script: mysql -u root -p << MYSQL create user '${DOMAIN}'@'localhost' identified by '${DOMAIN}'; create database ${DOMAIN}; GRANT ...
2
votes
1answer
799 views

Non-interactive & non-login shell environment?

I'm trying to understand non-interactive & non-login shells and having a hard time conceptualize the process a non-interactive & non-login shell goes through to start up. The way I ...
1
vote
1answer
480 views

rm -iR does not work inside a loop

Here is my loop ls -ltrd * | head -n -3 | awk '{print $NF}' | while read y; do rm -iR $y done output: rm: descend into directory oct_temp17? rm: descend into directory oct_temp18? rm: ...
2
votes
2answers
1k views

Which file is loaded and executed by a non-interactive non-login shell?

A non-login interactive shell (for example: when I open a Terminal window in Ubuntu) loads and executes the file ~/.bashrc. Now when I execute a shell script, a non-interactive non-login shell ...
1
vote
1answer
708 views

Confused about the meaning of an interactive and non-interactive shell when running a script

I have read the following in this question: A shell running a script is always a non-interactive shell, but the script can emulate an interactive shell by prompting the user to input values. I ...
-1
votes
2answers
42 views

prompted, looped commands

Is there a general way to do unix command and loop it over a list of files. For example, let's imagine we wanted to move all the files (but not directories) in a directory to another directory, but ...
0
votes
2answers
232 views

Why doesn't my bash include the interactive flag for this script?

Working with this answer I have tried this script to determine whether a script is being run from cron or interactively: #!/bin/bash # "reliable" interactive check case "$-" in *i*) ...
2
votes
2answers
4k views

How to choose a response for interactive prompt during installation from a shell script

I am writing a shell script to install all my required applications on my Ubuntu PC in one shot (while I can take a stroll or do something else). For most applications adding -y to the end of the apt-...
0
votes
2answers
2k views

Format zsh prompt according to the value of an environment variable

I want the color of my zsh prompt to be decided based on whether I'm inside a tmux session or not. In bash, it can be done by checking the value of $TMUX, but I can't find an equivalent method in zsh. ...
-1
votes
1answer
457 views

Issue running bash script as response to Interactive prompts

I am having some issues with running a shell script within an interactive prompt. The entire code works fine and if I replace the bash script with an echo 'hello world' line it works without any ...
4
votes
2answers
19k views

ssh command and non-interactive, non-login shell

There is a sentence in the post below. Difference between Login Shell and Non-Login Shell? The focus is here: Another way to get a non-interactive login shell is to log in remotely with a command ...
1
vote
1answer
414 views

Bourne shell: what does it execute on interactive, non-login?

I ask in that way, because according to https://unix.stackexchange.com/a/46856/84749, when I start screen it's an "interactive, non-login" I'm doing. What's actually happening is I'm logging into a ...
3
votes
1answer
273 views

PHP interactive script that calls nano

I have written simple PHP programs meant for the command line that run a script to completion with the hashbang at the top: #!/usr/bin/php -q <?php //etc However I need to write a script that ...
0
votes
3answers
8k views

Echo commands and output to file from interactive shell [closed]

I am looking for a graceful way to have bash write both the command I executed, followed by the output of that command to a file from an interactive prompt. Such that running a command like this: $...
0
votes
1answer
95 views

Respond to interactive spawned child process

There's a command from Amazon Web Services called eb init that allows you to initiate the current working directory as a elasticbeanstalk app. This command is interactive, meaning eb init will ...