/sortfile

By SplitFire on Jan 15, 2011

A basic sorting alias.
Usage: /sortfile file.txt

;-- File sorting alias
:-- by SplitFire
:-- usage: /sortfile file.txt

alias sortfile {
  var %file = $1
  if (!$isfile(%file)) {
    echo $color(ctcp) -ai2 * /sortfile: no such file $+(',%file,')
    halt
  }
  window -c @sort
  window -sh @sort
  loadbuf @sort %file
  write -c %file
  savebuf @sort %file
  echo $color(info) -ai2 * /sortfile: file $+(",%file,") sorted
}

Comments

Sign in to comment.
SplitFire   -  Jan 18, 2011

ARGH! damn typos :/ pressed shift + p instead of 0 heh

Ok fixed, ty for pointing it out :)

 Respond  
Fuzionx   -  Jan 18, 2011
echo $color(ctcpP -ai2 * /sortfile: no such file $+(',%file,')

You forgot a ) at $color(ctcpP

Beside that, nice work. :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.