The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
1answer
28 views

Head Script output explanation

So this shell script: #!/bin/bash head >/dev/null; head; almost always gives the same output when called with sequential numbers (e.g. seq 10000 | ./sscript) OUPUT: //blank line 1861 1862 ...
1
vote
4answers
36 views

Validating input

I have below script written to validate the input as an integer. But i also require "." to be included as an integer. For an instance if i give 1.5 is an input and run the script. It returns not an ...
1
vote
2answers
17 views

Find unique lines based on only a section

I am wondering if there is a way to split lines by some character (E.g. :) and find unique lines based on one part of this split. For example if I had the following piped in via stdin file1: line 4 ...
0
votes
0answers
18 views

Read single line from device at /dev/input/event0

When using "cat /dev/input/event0 | hexdump", I get a stream of data from the joystick that won't end until I use Ctrl-C to interrupt it. I want to get a single line of data I can use in a script I ...
2
votes
1answer
13 views

How to set the keymap for keyboards that are plugged in later?

I have configured my keyboard layout by adding a call to setxkbmap to my .xinitrc. This works for my laptop's internal keyboard and for any external keyboard that is plugged in when the X server ...
1
vote
1answer
37 views

Linux bash script input without using “read” [closed]

I need to create a bash script where a single argument is passed by the user (without using the "read" input option) at the terminal command line that creates a directory with that name, or otherwise ...
0
votes
4answers
31 views

Loop a program if the input is missing

I have this script that runs perfectly well, I would however like to re-run the script if the wrong input is entered, how could this be done? #! /bin/bash #! userInput - a script that reads in text ...
2
votes
2answers
74 views

Input from file: “advanced” (using less-than sign) vs. “beginner” syntax

I read the following in the grymoire: A simple example is changing "day" in the "old" file to "night" in the "new" file: sed s/day/night/ <old >new Or another way (for UNIX ...
1
vote
1answer
28 views

Bash: How do I make a command line call a script and pass two strings?

I have a simple bash script named text.sh which looks like this: #!/bin/bash read username read password echo "script attempted with $username $password" I want to call it using something like ...
1
vote
1answer
74 views

Read from /dev/input devices without root privileges

Is there a way to read from /dev/input devices, without needing root privileges? In my case, I would like to use the Python library evdev to read from multiple keyboards (so that I know which ...
2
votes
0answers
18 views

X configuration not being applied to device?

I've got a configuration file which I'm installing at /usr/share/X11/xorg.conf.d/52-synaptics-bcm5974.conf: Section "InputClass" Identifier "MacBook Pro Touchpad" MatchUSBID "05ac:0272" ...
1
vote
1answer
44 views

Is there any command that read their standard input in special cases? [closed]

I have been looking for lesser known commands that reads their standar input in special cases(missing arguments , for example). I'm thinking "cat" or maybe other command would fit here .. but I'm ...
0
votes
1answer
30 views

How to automaticallly accept when adding a repository?

Code : sudo add-apt-repository ppa:nemh/systemback sudo apt-get update sudo apt-get install systemback -y after entering the first command it will show something like this: Simple system backup ...
0
votes
1answer
61 views

How do I emulate sending keystrokes through a terminal program?

I need to send keystrokes virtually to a terminal program (like vi or emacs). I want to do something like this: echo -e 'iHello, world!\e' | vi and then have a vi session open with this buffer: ...
5
votes
2answers
24 views

maintain prompt despite ouput flow

Short version Can I maintain an input symbol (> for instance) at the bottom of the terminal so that the user can input despite text flowing above? Long version I am making a multi-process ...
4
votes
1answer
43 views

Working around a buggy keyboard / hacking an input stream?

When I type the key sequence oun quickly, the key sequence oun<F12> is emitted by my keyboard. (Update: actually, you must press-and-hold each key in the sequence in order to trigger the ...
1
vote
1answer
79 views

Block user input on interactive shell using “cat /dev/ttyS0”

I created an update routine for my device. The update process can be started using the serial console, SSH, telnet, a webserver or a REST API. Once the update started, I want to block all user input ...
1
vote
2answers
186 views

How to start script and put standard input in one command?

I have a console program which uses standard input and output. For example I call : ./program_name and after that I enter input I need to make this two actions in one command like: ./program_name ...
1
vote
1answer
71 views

How to automatically disable laptop keyboard/mouse with xinput when external keyboard/mouse is plugged in?

I know I can use xinput to disable my mouse and keyboard, and I usually type three commands every time I plug in my keyboard and mouse to my keyboard: xinput float 'AT Translated Set 2 keyboard' ...
2
votes
3answers
79 views

Why does using pipe '|' terminate the second process, is there a way to prevent it?

Just to give some context, I'm trying to run this command echo "set hive.execution.engine=tez;" | hive hive terminates as soon as "set hive.execution.engine..." has been entered into the hive ...
1
vote
1answer
30 views

Read from the terminal from a disowned background process

Do we still have a possibility to read input from keyboard even if the application is running in background (disowned)?
1
vote
0answers
43 views

Disable embedded keyboard when in a tty

I've been lately working on a netbook. I like to connected an external keyboard and mouse to it whenever I can, and I put the keyboard over the embedded keyboard. When on X, I used xinput to disable ...
1
vote
1answer
32 views

Sharing a keyboard over point to point network

I tried following http://superuser.com/questions/67659/linux-share-keyboard-over-network but had no success with the #1 solution. Then I tried socat and I had partial success -- it does work but ...
3
votes
0answers
33 views

How to obtain mouse events from the kernel when X is active?

When switching to a virtual terminal on my system, The kernel successfully delivers mouse events to a generic input event interface -/dev/input/event6 in my case- as well as legacy interfaces mouse1 ...
16
votes
2answers
861 views

What does CTRL+4 (and CTRL+\) do in bash?

I just found out by accident that CTRL + 4 closes programs reading stdin input from the command-line. This is how it looks when I type CTRL + 4 or CTRL + / into programs reading stdin ryvnf:~$ ...
6
votes
1answer
107 views

Extra output on input redirection

I have a folder with three files: $ ls a b c If I pipe the output of ls to wc, I get the right result: $ ls | wc -l 3 However, when I specify the input to wc as the output of ls, I get extra ...
0
votes
2answers
63 views

Interactively remove files in loop with standard input redirection

I need to interactively (i.e. rm -i) remove files stored in variable $to_remove (one path per line). Unfortunately my code doesn't work because standard input is already used by redirection ...
-1
votes
1answer
67 views

Is there a Linux keylogger which records the timestamp at which every input was given? If not how would one go about doing this?

In the end I want it so that I have a list of time steps which record, at each time step, what key was pressed (or what was the last key pressed in the given interval). I'm not sure such software ...
2
votes
3answers
98 views

How do I remap newline and carriage return regardless of the terminal used to connect?

All my configuration is stored in my github account (https://github.com/mnebuerquo/dotfiles) so I can just clone my repo and run my install script and my home is configured to use all my tools. I ...
1
vote
0answers
133 views

Ubuntu 14.04 - Multiple Griffin Technology Powermate Knobs

I am running Ubuntu 14.04, and I want to run multiple griffin powermate knobs: https://store.griffintechnology.com/powermate. I want to map them to different keys other than audio control. I want to ...
3
votes
0answers
138 views

Cannot use keyboard within Qt app without sudo

I have an embedded Qt application crosscompiled that runs on BeagleBone Black. It works Ok, but one thing- It doesnt accept keyboard input if i wont run in directly on BeagleBone Black preceeding with ...
1
vote
0answers
25 views

Application started in /etc/X11/xdm/Xsetup can't receive key presses

I'm using xdm (and I'd like to keep it that way) for a project and I need a terminal to run a script before the login prompt. The script requires some user input, however, it doesn't seem to work. ...
1
vote
0answers
32 views

Make X11 react on “dev/input/eventx”?

I have a debian 7 on kernel 3.8 running with a touchscreen. With evtest, I see that I get the screen's coordinates for device "dev/input/event2". How do I have to configurate my X server, that the ...
-2
votes
2answers
161 views

Enter a variable into a command in bash

My question should be simple for you guys. I am writing a simple script that runs a command but the file it would need is always different. Is there a way for it to ask: "Where is the file?" And ...
0
votes
1answer
539 views

How to clear log files periodically?

I am new to shell scripting. I want to clear log files in a directory based on the dates. I have managed to gather this code: DIR1='/home/u01/app/oracle/servers/DIR1/logs' ...
1
vote
2answers
50 views

How to input Chinese (JCK) in console without X running

Is it possible at all to input JCK languages (Traditional Chinese in my case) in the console without having X-windows running? All the help I have found online for Chinese input assume that X and ...
1
vote
1answer
55 views

Running a program and providing input

I have a program that runs from the command line. As soon as it runs, it asks for a text value and expects the return key to be pressed after that. Is that possible to create a bash script that runs ...
0
votes
1answer
140 views

predetermine script input text

I have a script that automatically sets up an emailing server based off what I enter for the following echo "Please enter your main domain: (Ex.: website.com)" read DOMINIO if [ $DOMINIO = "" ]; then ...
2
votes
0answers
87 views

manipulate multiple windows simultaneously

this is probably a long shot but I've been pondering it for a while. I realize that the actual use-cases of this sort of interaction are quite sparse. The main uses I can think of would be moving ...
1
vote
0answers
32 views

Is it Possible to use Mouse Movement in a Shortcut?

I'm interested in creating shortcut keys that use mouse movement as part of their trigger to send a keycode, for example so that I could have a shortcut like: ctrl + alt + [mouse movement down] ...
1
vote
0answers
174 views

How to get the mouse/keyboard raw events?

I want to intercept the raw events from the keyboard (or the mouse, eventually). I tried to use the /dev/input/[...] files, they are very practical and I can read the events of any key even caps lock ...
3
votes
2answers
169 views

When does cat finish reading from a pipe?

Given the following code, why does cat only print the contents of the pipe after I've typed \n or CTRL+D? What are the conditions for cat to actually print what it read? #include <stdio.h> ...
1
vote
0answers
404 views

USB bar code scanner not working on Raspbian

My USB bar code scanner (SYMBOL LS2208) is recognized as a HID. hid-generic 0003:05E0:0600.000F: hiddev0,hidraw0: USB HID v1.10 Device [\xffffffef\xffffffbe\xffffffa9\xffffffbe\xffffffa9Symbol ...
-1
votes
1answer
101 views

Accessing array elements within process substitution bash

I've got a text file which looks like this: b4238ca2-cb8d-11e4-8731-1681e6b88ec1,https,username,password,ipaddress b4238f0e-cb8d-11e4-8731-1681e6b88ec1,https,username,password,ipaddress ...
1
vote
0answers
90 views

How many bytes can a keypress return? And should a metafied key return more?

I've been tooling around w/ this input reader lately. Currently it only prints a report to stdout for each key pressed while it runs, but I would like to graduate it to a higher purpose sooner than ...
2
votes
4answers
165 views

input file stream to command

How is it possible to send a file stream to this command instead of a file? /usr/local/bin/wkhtmltopdf --title "$SUBJECT" -q $SOURCEFILE $OUTPUTFILE The file stream is from a string in PHP.
1
vote
1answer
172 views

Mapping two joysticks with Xorg

I already managed to map the input of a joystick to keyboard inputs by writing a file in my xorg.conf.d/ directory (the file is named 51-joystick.conf). Now I would like to map the inputs of a second ...
-2
votes
1answer
51 views

Using 'grep' to search for a specific pattern [duplicate]

I'm playing with the Linux terminal and I have to do a exercise which states that I have to find inside a file for any line that contains at least an a, b and c, it doesn't matter it the lane has 2 a, ...
0
votes
0answers
23 views

printf>stdin unusable with read [duplicate]

With read, sending "a" to stdin is not equivalent to pressing "a" (or use your favorite letter/key). Tested this: ~$ read -n1 & fg [1] 11620 read Then "typed" "a" into the read process stdin ...
0
votes
0answers
39 views

Input event for trackpad co-ordinates

I am making an app that requires the co-ordinates of the touch / swipe of the user. This is currently available only if you are running a VM ( Alt + F2/3/4/5...) using evtest. What do you think is ...