Take a full page screenshot with Firefox on the command-line

The Developer Toolbar GCLI and Shift+F2 shortcut were removed in Firefox version 60. To take a screenshot in 60 or newer: press Ctrl+Shift+K to open the developer console (⌥ Option+⌘ Command+K on macOS) type :screenshot or :screenshot –fullpage Find out more regarding screenshots and other features For Firefox versions < 60: Press Shift+F2 or go … Read more

How do I set tmux to open specified windows at startup?

You can write a small shell script that launches tmux with the required programs. I have the following in a shell script that I call dev-tmux. A dev environment: #!/bin/sh tmux new-session -d ‘vim’ tmux split-window -v ‘ipython’ tmux split-window -h tmux new-window ‘mutt’ tmux -2 attach-session -d So everytime I want to launch my … Read more

Input from within shell script

You can pipe in whatever text you’d like on stdin and it will be just the same as having the user type it themselves. For example to simulating typing “Y” just use: echo “Y” | myapp or using a shell variable: echo $ANSWER | myapp There is also a unix command called “yes” that outputs … Read more

How to call a function in shell Scripting?

You don’t specify which shell (there are many), so I am assuming Bourne Shell, that is I think your script starts with: #!/bin/sh Please remember to tag future questions with the shell type, as this will help the community answer your question. You need to define your functions before you call them. Using (): process_install() … Read more

sh read command eats backslashes in input?

Accrding to: http://www.vias.org/linux-knowhow/bbg_sect_08_02_01.html : -r If this option is given, backslash does not act as an escape character. The backslash is considered to be part of the line. In particular, a backslash-newline pair may not be used as a line continuation. It works on my machine. $ echo ‘\&|’ | while read -r in; do … Read more