File: spfix

package info (click to toggle)
epic 3.004-17.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,192 kB
  • ctags: 3,197
  • sloc: ansic: 40,843; makefile: 530; sh: 129; perl: 17
file content (20 lines) | stat: -rw-r--r-- 769 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * $spfix(text)
 *
 * This function returns text with the first word stripped off. We can't
 * use the $restw() builtin, because it will dump any extra spaces it sees
 * up to the first word (because the space is the word delimiter).
 * Basically what we do here is return all characters after the first word
 * (minus one space, since there is a one-space pad between all words that
 * any sane scripter will insert anyway). 
 *
 * You _must_ include the word before immediately preceding the spaces you
 * wish to keep. E.g., if you are hooking send_msg (which returns $0 as
 * recipient and $1- as the message), you must send $0- to the function,
 * not just $1-.
 */

alias spfix {
   @ function_return = mid(${rindex($right(1 $0) $0)+2} 1024 $0-)
}
#Crowman'95