Skip to main content

Questions tagged [interactive]

8votes
1answer
879views

Why does bash with "here documents" redirection start as interactive?

I found the following in man bash as a definition of interactive shell: An interactive shell is one started without non-option arguments (unless -s is specified) and without the -c option whose ...
Yakog's user avatar
0votes
0answers
42views

Why Linux return strange result on mount of very old nfs2 share?

I have a directory shared with nfs2 from very old unix (Interactive unix 4.1.1) the directory is mount correct from Interactive Unix client. Trying with Linux I have this strange result sudo mount -o ...
elbarna's user avatar
  • 13.6k
1vote
3answers
222views

How to interactively edit a file name from the terminal like with a file manager?

At the command line, one can rename a file by specifying the entire new name to mv mv oldname newname or using a regex with e.g. Perl's file-rename command. rename -d 's/old/new/' oldname But is it ...
Nahoj's user avatar
2votes
1answer
576views

Does tmux run-shell support interactive shell?

I know tmux run-shell can execute shell: $ tmux run-shell "echo start; echo \${var}end" start end But what if I want my shell could work interactively or read some user input, $ tmux run-...
Qiu Yangfan's user avatar
0votes
0answers
69views

How to regain script interactivity when `... | bash` best practices?

Let's say we have a simple script named question: #!/bin/bash read -rp "What's your name?" ans echo "Your name is $ans" Let's use cat for our example cat question | bash We ...
punkbit's user avatar
0votes
2answers
198views

Change behavior of bash script if executed from another script

I have a script (say Task.sh) (with executable permission): Pseducode: if [[ Not called from inside a script ]]; then echo 'Not called from inside a script' else echo 'Called from a script' fi I ...
Porcupine's user avatar
0votes
0answers
391views

Open GUI linux terminal in non-interactive mode

It would be helpful if I can open a terminal and run commands exactly as if they would be run by a non-interactive bash script, to test whether certain commands work in non-interactive mode without ...
user56834's user avatar
0votes
1answer
108views

bash: How to prompt for user input while reading file?

Following script statement for user input is nested in while loop under if block but it doesn't work and is being skipped. How do I get user input to work? exec 3<&0 && read -p 'Enter ...
Python_new's user avatar
1vote
0answers
194views

zsh vared: how to define custom completion?

I would like to launch a command that would read user input and pass each line as a new task to TaskWarrior: #!/bin/zsh set -e while vared -p 'task add> ' -eca task; do eval task add "${task[@...
khardix's user avatar
0votes
2answers
69views

> symbol appearing when interactively defining function in bash

The behaviour of my shell environment changed: Earlier, when pasting a function definition e.g. function exampleFunc { echo hello } to the shell, it would display as formatted and register the ...
Lee's user avatar
  • 549
1vote
0answers
73views

A script causes a parent script to stop

I have a third-party script that runs some complicated stuff. I run everything from an ssh session (the machine is a headless VM running Ubuntu 20.04). When I run it interactively, it runs normally. $ ...
n. m. could be an AI's user avatar
1vote
1answer
159views

Anyway to bind keyboard to dash (Debian Almquist Shell)?

Specifically Up/Down for history navigation. What I already know I understand dash is a minimalistic, no bloat, (somewhat) strict POSIX shell. I understand the philosophy behind it, and the reason ...
Lockszmith's user avatar
3votes
1answer
216views

Running a program outside of terminal

I'm trying to bring up a terminal to interactively ask for a file, and open it using a GUI program: foot /bin/sh -c 'file=`fzf`;(setsid xdg-open "$file" &)' I'm using setsid, because ...
Remko's user avatar
1vote
0answers
279views

how to force runuser to initiate an interactive shell the same way `bash -i` is used?

I need to run the following command as mruser as root systemctl --user status myservice To do this I use runuser runuser -l mruser -c "systemctl --user status myservice" This works perfectly ...
Dave's user avatar
  • 700
0votes
1answer
1kviews

How to get color in terminal but no color in output file [duplicate]

To show output in both terminal and to a file, tee can be used like below ls --color=auto | tee opfile But now, there is no color in the terminal. If I force colors, opfile also has colors which ...
balki's user avatar
  • 4,667

153050per page
close