Skip to content

Instantly share code, notes, and snippets.

View innermond's full-sized avatar

Gabriel Braila innermond

View GitHub Profile
@innermond
innermond / hyphens joiner
Created September 13, 2014 19:00
A piece of sed code that rejoin words splitted by hyphens
/\-$/,/[^\-]$/{
:a
N
/\-$/ ba
s/\-\n+//g
}
@innermond
innermond / infinite space
Created September 12, 2014 12:15
How to use cd command when traverse directories with spaces in name
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
i=0
for dir in $(ls -d *); do
# cd to book directory
my_dirname="${dir%%}"
mydir=(cd "./$my_dirname")
${mydir[@]}
#!/bin/bash
# install first the engine from http://mike.verdone.ca/twitter/
tweets="tweets.txt"
sleeptime=5
while read line;do
t update "$line" && sleep $sleeptime
done <$tweets