Questions tagged [interactive]
The interactive tag has no summary.
97 questions
-1
votes
1
answer
94
views
Why doesn't bash recognize alias in interactive mode?
How is this possible?
styx@LouSTyx:…$ GCOM "\pushdict now ignores prefix macro."
GCOM : commande introuvable
styx@LouSTyx:…$ type GCOM
GCOM est un alias vers « git commit -a -m »
8
votes
1
answer
907
views
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 ...
0
votes
0
answers
59
views
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 ...
1
vote
3
answers
305
views
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 ...
2
votes
1
answer
671
views
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-...
1
vote
0
answers
93
views
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 ...
0
votes
2
answers
243
views
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 ...
0
votes
0
answers
455
views
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 ...
0
votes
1
answer
126
views
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 ...
1
vote
0
answers
220
views
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[@...
0
votes
2
answers
91
views
> 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 ...
1
vote
0
answers
92
views
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.
$ ...
1
vote
1
answer
197
views
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 ...
3
votes
1
answer
230
views
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 ...
1
vote
0
answers
294
views
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 ...