Search/replace groups using sed
This is the most common way of my sed usage:
echo Good morning | sed 's/\(.*\s\+\).*/\1evening/g'
Here are brief notes on that ..
This is the most common way of my sed usage:
echo Good morning | sed 's/\(.*\s\+\).*/\1evening/g'
Here are brief notes on that ..
I’ll step through how to set custom fonts for xterm terminal. My default shell is tcsh
.
A hash can be assigned to a key of another hash using hash reference.
If you type echo "Hi\nHow\nHi\nAre\nHi\nYou?\nAre"
, you will get this in your terminal:
Hi
How
Hi
Are
Hi
You?
Are
Here’s how we can remove the duplicate lines using awk
..
Tiny snippets showing if/else use in awk
..
sed stands for stream editor.
This is the most common way of my sed usage:
echo [SOMETHING] | sed 's/old/NEW/g'
Python snippets to do number representation conversion among binary/decimal/hexadecimal.
This posts explain how the emacs in-built query-replace-regexp
command can be used to convert upper-cased strings to lower case.
I have a couple of theme packages installed on my emacs but I would like to assign a default theme.
I set the zenburn theme via a function zenburn
. I set the
leuven theme via another function leuven
. But in my emacs
startup I didn’t want to hard-code either of these function and thus
arose the need to set a variable to one of these functions.
Some times I would need to define an alias in tcsh which can have optional arguments. tcsh doesn’t seem to support that directly.
Here’s how I solve that problem.