path=' /usr/local/bin /usr/local/sbin /usr/local/lib /usr/local/include /usr/local/man /usr/bin /bin /usr/sbin /sbin ' path="$(printf "%s" "${path// /}" | /usr/bin/tr '\n' ':' | /usr/bin/sed -E 's/^:|:$//g')" printf "%s\n" "$path" | tr ':' '\n' export PATH="${path}" cd ~/Desktop curl -L -O http://ftp.gnu.org/gnu/sed/sed-4.1.4.tar.gz cd ~/Desktop/sed-4.1.4 # cf. Compiling GNU coreutils on Mac OS X, # http://codesnippets.joyent.com/posts/show/1799 ./configure --prefix=/usr/local/gnucoreutils make /usr/bin/sudo /usr/bin/make install ls -l /usr/local/gnucoreutils/bin/sed /usr/local/gnucoreutils/bin/sed --version man /usr/local/gnucoreutils/man/man1/sed.1 /usr/bin/sudo /bin/ln -is /usr/local/gnucoreutils/bin/sed /usr/local/bin/gnused # use GNU sed with case insensitive option echo Tool | sed 's/[Tt]/c/' echo Tool | gnused 's/t/c/i' # cf. "Extract title from HTML web page" on http://bosetsu.org/pub/docs/shell_cheatsheet.html curl -L -s http://codesnippets.joyent.com/posts/show/1835 | \ gnused -n 's/.*<[tT][iI][tT][lL][eE]>\(.*\)<\/[tT][iI][tT][lL][eE]>.*/\1/p;T;q' # cf. http://www.pixelbeat.org/cmdline.html curl -L -s http://codesnippets.joyent.com/posts/show/1835 | \ gnused -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q'
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Compiling GNU sed 4.1.4 on Mac OS X (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» iregex in regex shell osx mac bash unix sed tab gnu case insensitive
» Compiling GNU coreutils on M... in shell osx mac bash unix linux compile man manpage path info gnu seq coreutils infopath
» Delete carriage returns & ne... in shell osx mac bash vi unix vim file sed ed tr newline cr nl carriage return in_place
» Counting lines in awk grep shell osx mac bash line unix count file sed directory lines wc
» List the names & version num... in version shell osx mac bash unix sed list application mdfind lsregister number program mdls
» Handling single quotes in Bash in shell osx mac bash unix c string sed single ansi quote
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails