Nested grep with SSH

Bash
I have a following Shell command which runs successfully: sed -e "1,/^$(date -d -24hour +'%Y-%m-%d %H')/d" logfile | grep -A20 -B10 'Exception' | mai...
4 years ago

Passing variable between python scripts through shell script

Bash
I can't think of a way of doing what I am trying to do and hoping for a little advice. I am working with data on a computing cluster, and would like t...
4 years ago

Parsing parameters with zparseopts, but from within a sourced script

Bash
I have a zsh script myscr.zsh, which sources another script zparse.zsh, like this: #!/usr/bin/zsh # This is mysrc.zsh . $HOME/slib/zparse.zsh FOO BAR...
4 years ago

jq or xsltproc alternative for s-expressions?

Bash
I have a project which contains a bunch of small programs tied together using bash scripts, as per the Unix philosophy. Their exchange format original...
4 years ago

Conky/Dzen2 and variables from shell

Bash
I'm trying to make some dzen2 stuff, but i have some hard time on one point. I want to eval color variable between conky and dzen2. Something like th...
4 years ago

How can I pipe a command into the meteor shell?

Bash
Let's say I have a few directories, each running a different branch of a Meteor development server. I could cd to each directory, run meteor shell, an...
4 years ago

Running a shell script in the background from PHP

Bash
The scenario: I have a PHP script (accessed via the web) which generates a shell script which needs to continue to run even after the request ends. ...
4 years ago

Rename all files in directory from $filename_h to $filename_half?

Bash
Dead simple. How do I rename 05_h.png 06_h.png to 05_half.png 06_half.png At least, I think it's simple, but it's hard to Google for this kin...
4 years ago

Create a bash file for transfer file through tftp

Bash
I want to create shell script to invoke tftp transfer of particular file to my local machine this is the operation i want to do tftp 172.2.22.2 get ...
4 years ago

How to split the date and time from log file?

Bash
I want to display the date and time separated with space. The test.log file contains lots of other information as well. grep -E '[[:digit:]]{4}-[[:di...
4 years ago

How to reverse-i-search back and forth?

Bash
I use reverse-i-search often, and that's cool. Sometime though when pressing Ctrl+r multiple times, I pass the command I am actually looking for. Beca...
4 years ago

Child process to kill its parent whithout terminating itself

Bash
How can I kill parent process script from child process script, without terminating child process in Linux.
4 years ago

How to use exact session name to enter a screen?

Bash
I'm using screen to run a lot of different instances of an application and I name the the sessions "app1", "app2" etc. The problem is that if I have ...
4 years ago

More universal alternative to this sed command?

Bash
I have a variable called $dirs storing directories in a dir tree: root/animals/rats/mice root/animals/cats And I have another variable called $remo...
4 years ago

Bash arguments HELL while looping a complex ffmpeg command. How do I escape it?

Bash
I am trying to create a waveform png for a bunch of videos using ffmpeg -filter_complex The single line command works fine & produces the expecte...
4 years ago

Unix Grep Exact Match Issue

Bash
I have a text file Input.txt 7643 , PHP/5.6.16 7649 , PHP/5.3.10-1ubuntu3.21 10230 , PHP/5.3.10-1ubuntu3 14415 , PHP/5.6.17 14414 , PHP/5.5.9-1ubuntu...
4 years ago

Temporarily change current working directory in bash to run a command

Bash
I know I can use cd command to change my working directory in bash. But if I do this command: cd SOME_PATH && run_some_command Then the ...
4 years ago

replace exact number in shell

Bash
I have following matrix: 0.380451 0.381955 0 0.237594 0.317293 0.362406 0 0.320301 0.261654 0.38797 0 0.350376 0 0 0 1 0 ...
4 years ago

How to merge two branches (my local with a remote branch)

Bash
I created the branch testDB and I want to pull from the databasecheck, which a colleague's branch, into the former. I know that I have first to fetch...
4 years ago

bash command substitution on external script function receives incorrect exit status

Bash
This example was tested on Mac El Capitan with bash main_script.sh: NOTE: func_a and func_b are identical except for the line that the local var...
4 years ago