about:bash

Target : Self.

I am at ${HOME} downloads

A friendlier greeter.

Let’s start from the beginning shall we. 🙂

Everytime you login to your box, you’re technically logging into a “ bash login shell, ” and not as what you might expect a dash shell. ← The latter typically gets used to boot up your box, in a very quick fashion, but more on that later! 😉

To avoid further confusion, let’s have a look at their respective descriptions. 😉

From :

apt-cache show dash
…
Description-en: POSIX-compliant shell
 The Debian Almquist Shell (dash) is a POSIX-compliant shell derived
 from ash.
 .
 Since it executes scripts faster than bash, and has fewer library
 dependencies (making it more robust against software or hardware
 failures), it is used as the default system shell on Debian systems.
Homepage: http://gondor.apana.org.au/~herbert/dash/
Description-md5: 8d4d9c32c6b2b70328f7f774a0cc1248
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: minimal

From :

apt-cache show bash
…
Description-en: GNU Bourne Again SHell
 Bash is an sh-compatible command language interpreter that executes
 commands read from the standard input or from a file.  Bash also
 incorporates useful features from the Korn and C shells (ksh and csh).
 .
 Bash is ultimately intended to be a conformant implementation of the
 IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2).
 .
 The Programmable Completion Code, by Ian Macdonald, is now found in
 the bash-completion package.
Homepage: http://tiswww.case.edu/php/chet/bash/bashtop.html
Description-md5: 3522aa7b4374048d6450e348a5bb45d9
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: minimal

In other words : Always use bash for your own personal scripting needs. If modifying — aka tinkering — any system files (why would you, right ! ;-)), in the case of *.sh files, then always expect — and code for — dash. 😉

The first file that gets read in by your login shell is the so called “.profile” file. So [let’s start from there](https://wp.me/pNJrg-IK "About custom user directories."), and follow its order to conclusion.

I.e. :

  • $HOME/.profile
  • $HOME/.bashrc
    ↑ Contains a for loop, to include/source all files in ~/.shell.d/

    1. $HOME/.shell.d/aliases.sh
    2. $HOME/.shell.d/colors.sh
    3. $HOME/.shell.d/exports.sh
    4. $HOME/.shell.d/greeter.sh
    5. $HOME/.shell.d/functions.sh
      ↑ Same as above.

      • $HOME/.shell.d/functions.d/*.sh

One of the reasons for splitting up all those files into tiny bits is : Over time the amount of functions I created, became “ unmanageable. ” 😉 Just imagine having one “ functions.sh ” file which contained over 20 functions, can you imagine what a spelling mistake, or an oops I forgot to close one of them proper would do. 😀

In time I’ll upload my functions to cloudup, and will source it here. For now I just want to let sink in what I posted.

From hereon end I’ll source the files, as mentioned above. Any comments, and positive feedback are encouraged. In the case of : People copying, and pasting my files — for their own usage ! The files I provide here, are : “ As is ! ” I.e. They should work on every “ debian-alike ” system. And if you’re a Harry Potter fan, then you won’t mind Dobby … 🙂

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ];
then
  # include .bashrc if it exists
  if [ -f "$HOME/.bashrc" ];
  then
	. "$HOME/.bashrc"
  fi
fi
## Path to local scripts.
## I.e. : User scripts — provided that their x-bit is set — can be invoked,
## by their name, as opposed to : ./yourscript
## I don’t like to clutter my $HOME : See https://wp.me/pNJrg-IK
if [ -d "${HOME}/.usr/bin" ];
then
  ##  Let’s give precedence to our own scripts, and perhaps our own builds ‽
  ##  By putting our path, in front of the system’s. ; )
  PATH="${HOME}/.usr/bin:$PATH"
fi
##  Path to texlive-2013 portable installation.
##  https://www.tug.org/texlive/quickinstall.html
##  Yes, I really might want to look into updating mine. ; )
TeXLive="/vault/texlive.portable/bin/x86_64-linux"
if [ -d "$TeXLive" ];
then
  PATH="$TeXLive:$PATH"
fi

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
#
##  Don't put duplicate lines or lines starting with space in history.
##  See bash(1) for more options
HISTCONTROL=ignoreboth
##  For setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
#
##  If I hardcode my paths, for my convenience,
##  then I expect bash_completion to honor those,
##  instead of escaping them with '\'... Ugghhhh ← Bad design move. : (
##  http://askubuntu.com/questions/41891/bash-auto-complete-for-environment-variables
if
  ((BASH_VERSINFO[0] >= 4)) && ((BASH_VERSINFO[1] >= 2))
then
##  Option is valid as of bash version 4.2
  shopt -s direxpand
fi
#
##  If set, a command name that is the name of a directory is executed,
##  as if it were the argument to the cd command.
##  This option is only used by interactive shells.
##  https://unix.stackexchange.com/questions/103524/bash-not-setting-autocd
##  The autocd option was added in bash 4.0 (alpha).
##  The cross-platform solution.
#   [ "${BASH_VERSINFO[0]}" -ge 4 ] && shopt -s autocd
if
  ((BASH_VERSINFO[0] >= 4)) && ((BASH_VERSINFO[1] >= 0))
then
##  Option is valid as of bash version 4.0
  shopt -s autocd
fi
##  append to the history file, don't overwrite it
shopt -s histappend
##  check the window size after each command and, if necessary,
##  update the values of LINES and COLUMNS.
shopt -s checkwinsize
##  If set, the pattern "**" used in a pathname expansion context will
##  match all files and zero or more directories and subdirectories.
#   shopt -s globstar
#
##  make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
##  set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi
##  set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac
##  uncomment for a colored prompt, if the terminal has the capability.
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  ##  We have color support; assume it's compliant with Ecma-48
  ##  (ISO/IEC-6429). (Lack of such support is extremely rare, and such
	##  a case would tend to support setf rather than setaf.)
	color_prompt=yes
    else
	color_prompt=
    fi
fi
if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]I am @: \[\033[00m\]\[\033[01;34m\]\w\[\033[00m\]/'
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
##  If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\033]0;${debian_chroot:+($debian_chroot)}I am a FREE Elf! \u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac
##  Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
##  Miscellaneous
#
export BashDir="$HOME/.shell.d"
#
##  Alias definitions, and other startup files.
#
##  I’ve opted to create a so called “ "$HOME"/.shell.d/ ” folder,
##  In which I’ve put my own additions.
#
##  If ${BashDir} is a folder, and search permission is granted, then …
if [[ -d "$BashDir" ]] && [[ -x "$BashDir" ]];
then
##  For each file found, bearing the ‘ .sh ’ extension, do … 
  for files in "$BashDir"/*.sh;
  do
##  Source it, provided it is readable, and NOT executable! ; )
##  With the current umask, they should always default — upon creation — to: 664,
##  or -rw-rw-r-- for those who know how it works.
    if [[ -r "$files" ]] && [[ ! -x "$files" ]];
    then . "$files";
    fi
  done;
  unset files
fi
##  enable programmable completion features (you don't need to enable
##  this, if it's already enabled in /etc/bash.bashrc and /etc/profile
##  sources /etc/bash.bashrc).
if [[  -f "$Completions" ]] && ! shopt -oq posix;then . "$Completions";fi
##  Gpg essentials.
#
##  pub   4096R/575E4869 2014-09-27 [expires: 2016-09-26]
##        Key fingerprint = 0C50 B3A4 D11E C611 B33F  1A80 C33F F74C 575E 4869
##  uid                  Alexander Möller (This will be my main sign-key.) <who.is.johnny@gmail.com>
##  uid                  [jpeg image of size 20236]
##  sub   4096R/D692F093 2014-09-27 [expires: 2016-09-26]
#
##  Function to run upon exit of shell.
function _exit()
{
  printf '%b\n' ${Cyan}"\tDobby lives only to serve MASTER!${Nc}"
  tput smcup
  clear
}
trap _exit EXIT
#
##  I prefer to start my shell in a subfolder.
cd "$dta"

##  To disable an 'alias', in this shell, either issue an 'unalias NAME',
##  or to disable on a per command basis: Put an '\' in front of your command.
##  A double '##' means explanation.
##  A single '#' either means: A single command, or a commented out command.
#  A standalone '#', like in this line means: Next codeblock/alias.
##  Spit out the current used environment,
##  and make it more intelligible by sorting it alphabetically first.
##  It's also a quick way for looking up a certain alias. ; )
##  Hit 'q' to exit less. ; )
#
##  Why ‘ less, ’ because it’s ‘ more. ’ ; )
##  See “ man less ” for more.
#
alias sortless='sort -g|less'
alias env='env|sortless'
#
##  Useful alias, to use for example while making tar-archives. ; )
tardate="$(date +"%F")"
export tardate
#
##  Navigation.
##  The following 2 conventions, totally depend on perspective. ; )
##  Personally I feel this to be more intuitive, than using 'p' the whole time.
##  'Previous' directory.
alias p='cd -'
##  'Next' directory.
alias n='cd -'
##  Go 'up' one directory.
alias up='cd ..'
##  Go 'up' two directories.
alias up2='cd ../../'
##  Go 'up' three directories.
alias up3='cd ../../../'
#
##	Useful remove, copy and replace aliases.
alias rm='printf "%b\n" "\tUh oh\x21\n\tJust put the \x27\x5c\x27 in front \
of the \x27rm\x27 command.\n\tAnd you should be good to go. \x3b\x2d\x29"'
#  · v - Explain what's being done.
#  · i - Interactive mode, ask before overwriting anything.
#  · u - Update/move only, if file is newer,
#        or doesn't exist on the receiving end.
#  · a - 'Archive' mode.
alias cp='cp -vaiu'
alias mv='mv -viu'
##  Remove an empty directory, and be 'verbose' about it.
alias rmdir='rmdir -pv'
##  Make a directory,
##  and create its siblings, if any.
alias mkdir='mkdir -pv'
#  Only report, when actual changes are made.
alias chmod='chmod -c'
#
##  File, and folder listings, miscellaneous settings.
##  Enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
    eval "$(dircolors -b)"
    alias l='ls --color=auto'
    alias l.='ls -d  --color=auto .*'
    alias la='ls -a --color=auto'
    alias ll='ls -l --color=auto'
    alias ld='ls -d --color=auto */'
    alias lh='ls -lh --color=auto'
    alias lhS='ls -lhS --color=auto'
    alias lx='ls -X --color=auto'
    alias lha='ls -lha --color=auto'
    alias lS='ls -S --color=auto'
    alias lsh='ls -sh --color=auto'
    alias list='ls -lhtFG --group-directories-first --color=auto'
    alias rlist='ls -lrhtFG --group-directories-first --color=auto'
    alias dir='dir --color=auto -clth'
    alias grep='grep --color=auto'
    alias igrep='grep -i --color=auto'
    alias ingrep='grep -in --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi
#
##	Enhance your calm John Spartan.
##	Replacement echo:
##  Due to conflicting historical implementations of the echo command,
##  POSIX® recommends that printf is preferred over echo.
##  Also see: http://wiki.bash-hackers.org/commands/builtin/printf
#
##  A lot of scripts I've viewed online (including my own),
##  require or rely heavy on the 'echo' builtin.
##  The following alias makes sure,
##  everything remains 'backwards compatible'. ; )
##  This includes, and isn't limited,
##  to the \escapes I often use in my code. ; )
alias echo="printf '%b\n'"
##  The export ensures the “ echo ” will function properly in “ legacy ” scripts.
export echo
##  The following will make 'printf' print out everything it's provided with,
##  in a LITERAL sense, it's also the preferred way of using 'printf',
##  as mentioned in the article above. ; )
alias paste="printf '%s\n'"
##  Same as with “ echo. ”
export paste
#
##  A quick and dirty way to show all hidden folders in your home directory,
##  or any other (you've 'rw(x)' permission(s) for). ; )
alias lhd='echo .{,*}/|tail -n +4|less'
##  Same as above, but do it for visible folders only.
##  Using 'v' here instead of expected 'l' for list.
##  The 'ld' alias from line 28 lists everything horizontally. ; )
##  Whereas 'vd' lists vertically. If the current folder is empty,
##  then a '*' appears in "less'" output.
##  Why use 'less' you say? Because it's 'more'. : )
##  Hit 'q' to exit less. ; )
alias vd='echo {,*}/|tail -n +2|less'
#
##	Disk usage.
alias du='clear && du -sh 2>&-|less'
##  '2>&-' ←  This effectively kills any output to 'stderr',
##  it's better than using '2>/dev/null' ; )
##  I've no need to be reminded of the following:
##  "df: `~/.gvfs': Transport endpoint is not connected"
##  I use 'ecryptfs', it might have something to do with that. : )
alias df='clear && df -Th --total 2>&-|less'
#
##  Display amount of free and used memory in the system
alias free='clear && free -lmt|less'
#
##	Let's say: You've installed a new font in for example ~/.fonts \?
alias Newfont='sudo fc-cache -f -v'
#
##	My most common gzip usage.
alias gzip='gzip --best -v ' #	Name of file or files when using a loop.
#  gzip -c index.html.en > index.html.test.gz
#  gunzip -c type.cursus.html.gz > type.cursus.html
#
##	wget usage.
##  Of course I could set all the following options,
##  in its own dedicated ~/.wgetrc.
##  Let's pretend we're a a generic tor-browser user. lol
##  E.g.:
##  "Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0"
##  Also see: https://www.torproject.org/download/download-easy.html.en
UAF="Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0"
RoBot="Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
alias wget='wget -S --random-wait --user-agent="${UAF}" --progress=bar'
##  I know my ip-address doesn't match Google's,
##  but we're checking for the existence of a page.
##  I.e. We're doing a HEAD request, instead of a GET request.
##  Make sure to '\' escape the previous 'wget alias'. ; )
##  'set -x' revealed wget sending an 'user-agent' twice. lol
alias spider='\wget -S --user-agent="${RoBot}" --spider'
##  I've Tor functioning as 'a transparent proxy', on my box.
##  I may or may not, write a post about it later on?
alias Guy='sudo -u anonymous \wget -S --user-agent="${UAF}" --progress=bar'
##  Same here as 'spider' from up above, only we're doing it anonymously now.
alias Fawkes='sudo -u anonymous \wget -S --user-agent="${RoBot}" --spider'
#
##	Determine mimetype, and be brief about it.
##  Option '-L' causes symlinks to be followed, as the like-named option in 'ls'
##  (on systems that support symbolic links).
##  This is the default if the environment variable POSIXLY_CORRECT is defined.
alias file='file --mime-type -b'
alias encoding='file --mime-encoding -b'
#
##	Media related.
##  https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
##	ffmpeg -version
alias ffv='ffmpeg 2>&1 | head -n1'
##	Shorthand for 'ffmpeg -i'
alias ffi='ffmpeg -i'
#
alias sdof='composite first.jpg -blend 30% -depth 30% last.jpg middle.jpg'
#
##	Enhanced copying.
#  · z - Compress the stream.
#  · h - Output in human readable format.
#  · H - Preserve Hard links, if any.
#  · a - 'Archive' mode.
#  · X - Preserve eXtended attributes, if any.
#  · v - Be verbose.
#  · u - Update.
#  · p - --partial || --progress.
#  · d - Delete before transfer.
#  · n - Dry run.
#  --remove-source-files #  Sender removes synchronized files (non-dir)
##  See 'man rsync' for more info on the matter.
alias rsync='rsync -vazh --progress'
alias usync='rsync -vazhu --progress'
alias dsync='rsync -vazh --progress --delete'
#
##	Macromedia flash specific
alias findsol="find -iname '*.sol' | wc -l"
alias printsol="find -iname '*.sol' -printf '%p\n'"
alias rmsol='find -iname '*.sol' -exec rm "{}" \;'
#
#Search and show available packages.
alias aptsearch='apt-cache search '
alias aptshow='apt-cache show '
#
##	Timestamp
alias dtouch='find . -type d -exec touch -t 201010100101.01 {} \;'
alias ftouch='find . -type f -exec touch -t 201010100101.01 {} \;'
#
##	Rights and ownership managment.
##  COO = the Current Owner Only.
##  . = CWD
##  CWD = Current Working Directory.
##  group = it refers to the current user’s active group.
#
##  For more: Read the fine manual. ; ) man chmod
#
##  Mark all files found — starting from . — to read, and write for COO.
alias chf2rw='find . -type f -exec chmod 600 {} \;'
##  Mark all files found — starting from . — as read-only for COO.
alias chf2ro='find . -type f -exec chmod 400 {} \;'
##  Mark all files found — starting from . — as executable for COO.
alias chf2ex='find . -type f -exec chmod u+x {} \;'
##  Mark all files found — starting from . — as NOT executable for COO.
alias chf2ux='find . -type f -exec chmod u-x {} \;'
##  Mark all folders found — starting from . — to sticky, and accessible for COO.
alias chd2st='find . -type d -exec chmod 1700 {} \;'
##  Mark all files found — starting from . —  as read-only to active group.
alias chf2gr='find . -type f -exec chmod 660 {} \;'
##  Mark all folders found — starting from . — to sticky, and accessible to group.
alias chd2gr='find . -type d -exec chmod 1770 {} \;'
##  Mark all files found — starting from . — to read-only, for everyone.
alias chf2wr='find . -type f -exec chmod 644 {} \;'
##  Mark all folders found — starting from . — to read-only, for everyone.
alias chd2wr='find . -type d -exec chmod 755 {} \;'
##  Mark file with NAME as executable.
alias mexec='chmod u+x' # NAME
##  The inverse from above.
alias uexec='chmod u-x' # NAME
#
##	Alternatives to the ones above.
#  The perl examples should be on ONE line ‽
#  alias ch2normal="perl -MFile::Find -e \
#  'find sub { -f && chmod 0644, $_; -d && chmod 00755, $_ },"."'"
#  alias ch2sticky="perl -MFile::Find -e \
#  'find sub { -f && chmod 0644, $_; -d && chmod 01755, $_ },"."'"
#  alias ch2private="perl -MFile::Find -e \
#  'find sub { -f && chmod 0600, $_; -d && chmod 01700, $_ },"."'"
#
##  The -print0, and -0 flags ensure the proper handling of names with spaces.
alias xargsf='find . -type f -print0 | xargs -0 chmod 644'
alias xargsd='find . -type d -print0 | xargs -0 chmod 1750'
#
##	Secure deletion tools.
alias qdel='srm -lv'
alias qrdel='srm -lvr'
alias qhist='srm -lv ${HOME}/.bash_history && touch ${HOME}/.bash_history'
#
##	Show my open connections
alias lsofu='lsof -i -n -P|tail -n +2|sortless'
#
##	Comes out as: Dow, Month Day, Year
##	e.g.: Saturday, July 21, 2012
alias todayis='date +"%A, %B %-d, %Y"'
#
##  Nano.
alias nano='nano -Amu'
#
##	Imagemagick
alias identify='identify -verbose'
#
#  For 'cryptographic' purposes.
alias randkey='head -c 48 /dev/urandom | openssl enc -base64'
#
##  Alias for my markdown usage.
alias md='python -m markdown -x abbr -x footnotes -x def_list' # -x codehilite
#
## vorbistools
#
alias vg='vorbisgain -sqaf'
alias vc='vorbiscomment -l'
#
#	Extended filesystem permissions.
alias lsattr='lsattr -v'
alias ldattr='lsattr -vd'

##  I might need the following files in their ‘ short-form, ’ at some point ‽
##  While using my terminal, in an interactive fashion that is.
export Aliases="$HOME/.shell.d/aliases.sh"
export Colors="$HOME/.shell.d/colors.sh"
export Functions="$HOME/.shell.d/functions.sh"
export Exports="$HOME/.shell.d/exports.sh"
export Greeter="$HOME/.shell.d/greeter.sh"
export Completions="/etc/bash_completion"
#
##  gpg public-keys
#export MyKey=575E4869
#export Yours=12345678
##  Navigation.
export bashd="$HOME/.shell.d/"
export functions="$HOME/.shell.d/functions.d"
export pgp="${HOME}/.gnupg"
export shell="${HOME}/.usr/bin"
export clip="${HOME}/Templates"
export dta="${HOME}/Downloads"
export docs="${HOME}/Docs"
export cobra="${docs}/python"
export dropbox="${docs}/Dropbox"
export dox="${docs}/Documents"
export pdf="${docs}/PDF"
export src="${docs}/Sources"
export public="${docs}/Public"
#export bdsm="${docs}/LaTeX"
#export epub="${docs}/Epub"
export pix="${HOME}/Pictures"
export photos="${pix}/Photos"
export music="${pix}/Music"
export videos="${pix}/Videos"
export rips="${videos}/dvdrip-data"
export series="${videos}/Series"
export anime="${series}/Anime"
export xgrabs="${videos}/xgrabs"
export youtube="${videos}/YouTube"
#export otheruser="/home/you"
export rclocal="/etc/rc.local"
export fwrules="/etc/iptables.rules"
export MOZ_DISABLE_PANGO=1

##	Mandatory 'root' check ; )
##	Yes, you may disable this check, but ... I put it in here, for good reason.
##	You are hereby warned. ; )
if [ "$UID" = "0" ];then
  echo "\tError: \"${USER}\" isn't allowed to use \"YOUR\" bash functions."
  echo "\tUse \"sudo -i\" instead, for \"admin\" purposes. \x3b\x2d\x29"
  exit 1
else
  FuncDir="$BashDir/functions.d"
  #
  ##  If ${FuncDir} is a folder, and search permission is granted, then …
  if [[ -d "$FuncDir" ]] && [[ -x "$FuncDir" ]];
  then
  ##  For each file found, bearing the ‘ .sh ’ extension, do … 
    for files in "$FuncDir"/*.sh;
    do
  ##  Source it, provided it is readable, and NOT executable! ; )
  ##  With the current umask, they should always default — upon creation — to: 664,
  ##  or -rw-rw-r-- for those who know how it works.
      if [[ -r "$files" ]] && [[ ! -x "$files" ]];
      then . "$files";
      fi
    done;
  unset files
  fi
fi

##  -------------------------------------------------------------
##  Greeting, motd etc...
llength="80"
printf -v line '%*s' "$llength"
line="${line// /-}"
Uptime="$(w|head -n 1|awk -F' ' '{print $3 " " $4}')"
printf '%b\n' "$line"
printf '%b\n' "\tWelcome to:\n\t$(uname -n)\n"
printf '%b\n' "\tUp and running $(uname -o) — on the $(uname -i) platform — \
for the past ${Uptime%,*}."
printf '%b\n' "$line"
printf '%b\n' "\tIt’s now: $(date)"
printf '%b\n' "$line"
##  I escape my used 'smileys',
##  because this or that blog may interpret them as such. ; )
##  Thus '\x3a\x2d\x29' prints as ': )', plus the dash.
##  And '\x3b\x2d\x29' prints as '; )', plus the dash.
printf '%b\n' "\tYour username is: \u201c\u200a${USER^}.\u200a\u201d \x3a\x2d\x29\n"
printf '%b\n' "\tMay \u262E be with you.\n"
unset Uptime

Kindest regards,

Alex

ღ Ƹ̵̡ Ӝ̵̨̄ Ʒ ☆ ˜ ” * ° • . ¸ł¸ . • ° * ” ☆ ★ ☆ ę ˜

♫ d(。◕‿◕。)b ♪♪

Use the contact-form below, for feedback purposes.







Back to top.

Target : Self.

Leave a Reply (in md, or text) …

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s