Skip to main content
34 votes
Accepted

Is it possible to send input to a tmux session without connecting to it?

This question has a solution on ServerFault: Run command in detached tmux session It uses the send-keys command, which is documented in the man-pages: General Commands: TMUX(1) The following is a "...
igal's user avatar
  • 9,986
21 votes

Lubuntu 16.04 xsetwacom: "Unable to find an output 'DVI-I-0'."

Instead of the monitor name from xrandr, use HEAD-[head index]. For instance, use HEAD-0 for the first monitor listed, HEAD-1 for the second, etc. e.g. xsetwacom --set "Wacom Intuos PT S 2 Pen stylus"...
tille S.'s user avatar
  • 211
20 votes
Accepted

How to pipe commands to a process running in the background?

I guess that is impossible with a "real" pipeline. Instead you can use a FIFO (named pipe, see man mkfifo) or (more elegant but more complicated) a Unix socket (AF_UNIX). ./background-proc </path/...
Hauke Laging's user avatar
  • 90.2k
19 votes
Accepted

How to pass argument to script which is input to bash

I believe what you are looking for is the -s option. With -s, you can pass arguments to the script. As a dummy example to illustrate this: $ echo 'echo 1=$1' | bash -s -- Print 1=Print Here, you ...
John1024's user avatar
  • 75k
18 votes

How send multiple command as input in a program?

I would suggest a here document ./my_proc << END_OF_INPUTS username phone number whatever END_OF_INPUTS
glenn jackman's user avatar
16 votes
Accepted

Taking password from a file while SSH ing into a machine

SSH with 'password in a file' is commonly used as public key authentication. Create a key pair using ssh-keygen, upload the public key to the other host: scp ./.ssh/id_rsa.pub [email protected]:~/ and ...
Lambert's user avatar
  • 12.7k
15 votes
Accepted

What happens to cron-job that requires user prompt?

Tools running by the cron daemon get an environment from the cron, and not from your shell. The cron doesn't provide a standard input for these tools, more exactly it provides a faked one from the /...
peterh's user avatar
  • 9,808
13 votes
Accepted

What's the best way to actually "type" special UTF-8 chars?

You could use Onboard Onscreen Keyboard which is available in most distros. It allows to create a custom layout with the characters you need, e.g. In case you don't want to create a new layout it ...
Artem S. Tashkinov's user avatar
12 votes

How to pipe commands to a process running in the background?

If you wanted to start the command in background and have a file descriptor to send data to it via a pipe. With zsh or bash, you could use a redirection to a process substitution. exec 3> >(...
Stéphane Chazelas's user avatar
12 votes

What's the best way to actually "type" special UTF-8 chars?

Actually... I am already happy with any method that improves mine. If you're using symbols often enough to remember their hex codes: GTK-based UI applications (a.k.a. an overwhelming portion of them) ...
iridia's user avatar
  • 129
11 votes
Accepted

CTRL+D vs CTRL+C

No, it is not true. However, it is true to say that Ctrl+D signals an End of Transmission (EOT) event which will generally cause a program reading input to close the input file descriptor. Ctrl+D is ...
DopeGhoti's user avatar
  • 76.7k
11 votes

WSL 2 Input/Output Error

Presumably it's too late to help the original asker, but I had the same issue today, found this question while troubleshooting it, and did manage to fix my WSL installation, so I figured I'd leave ...
Alex's user avatar
  • 111
9 votes
Accepted

Tmux hidden input at command line

It has been a while, but in case you are still interested - executing stty sane helped immediately. See Fix terminal after displaying a binary file
kostja's user avatar
  • 218
9 votes
Accepted

How many ways are there in total to feed a command with input?

At least the following: Command options: foo --bar Standard input: foo | bar or bar < foo File(s): foo *.* (or by opening file(s) via code in foo) † Environment export: export foo=bar; baz ...
Neil McGuigan's user avatar
9 votes
Accepted

ctrl+shift+e causes beeping

Seee https://askubuntu.com/a/1039039 One needs to run ibus-setup and in the tab "Emoji" change the shortcut (click on the three dots that are focused in the screenshot)
nafg's user avatar
  • 208
9 votes
Accepted

Create files from a list of text files

You can use xargs. After changing to the new directory, xargs -d '\n' touch -- < path/to/ls.txt Note that if there were originally any directories in the ls output, these will be created as plain ...
steeldriver's user avatar
  • 81.6k
8 votes

Taking password from a file while SSH ing into a machine

You can use sshpass to do that: sshpass -f password.txt ssh -T [email protected]
Jakuje's user avatar
  • 21.4k
8 votes

What's the best way to actually "type" special UTF-8 chars?

Most modern OSes have an emoji picker for typing emojis, kaomojis and special symbols. For example in Ubuntu and many other Linux distros you use Ctrl+. to open it Depending on your settings and your ...
phuclv's user avatar
  • 2,095
7 votes

Unprintable characters as input in command line

The printf utility supports octal character escapes: In addition to the escape sequences shown in XBD File Format Notation ( '\\', '\a', '\b', '\f', '\n', '\r', '\t', '\v' ), "\ddd", where ddd ...
ilkkachu's user avatar
  • 141k
7 votes

Why can't an input file be an output file?

cat x y > y would be the same as cp x y (because y would have been truncated by the time cat started) followed by cat y >> y. cat x >> x would be an infinite loop until your disk was ...
Michael Homer's user avatar
7 votes

How can I replace oe with ö while typing it?

X recognises a Multi_key key (or Compose), The Desktop Environment (e.g. Gnome) might use a key such as the Windows key on the keyboard to serve as the Compose key (it can be configured in Gnome ...
Rizzer's user avatar
  • 528
6 votes
Accepted

cat into stdin then pipe into program keeps forked shell open, why?

For the cases where it "works", you are leaving a process running cat which is reading its standard input, which has not been closed. Since that is not (yet) closed, cat continues to run, leaving its ...
Thomas Dickey's user avatar
6 votes
Accepted

I cannot type space in interactive command mode

The most likely explanation is that you've accidentally bound Space to a command that has no visible effect in one of your configuration files. Check your shell initialization files for stty commands....
Gilles 'SO- stop being evil''s user avatar
6 votes
Accepted

Does the shell have the same standard input, standard output, standard error like each other command?

It's the same as any other program. This allows you to redirect and pipe the I/O like other programs. echo "cat filename" | bash will execute the cat filename command when bash reads its standard ...
Barmar's user avatar
  • 9,956
6 votes

How can I run a shell script on input device event

@paulequilibrio thanx to your post I modified your script to get mi IR remote next, prev and stop buttons working with Rhythmbox without lirc in Ubuntu 18.04, this added to the auto run its marvellous....
Jorge Velez's user avatar
5 votes

What is BTN_TRIGGER_HAPPY?

Specifically for BTN_TRIGGER_HAPPY, here is the commit where that range was added. These events appear to just be generic joystick events for devices with more than 16 buttons. As for the name, I ...
gulkeme's user avatar
  • 51
5 votes

How can I respond to a prompt within a shell script running in background?

If you can provide all the inputs when the script starts, then do so, by redirecting the program's input. That is, instead of running /path/to/installer, run { echo '/the/path/where/to/install'; ...
Gilles 'SO- stop being evil''s user avatar
5 votes

How can I respond to a prompt within a shell script running in background?

You can echo your answer into standard input of script by using a pipe. echo "My/Path/not/default"| yourscript.sh
X Tian's user avatar
  • 10.5k

Only top scored, non community-wiki answers of a minimum length are eligible