File: demo_has_prefix

package info (click to toggle)
runawk 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 712 kB
  • sloc: awk: 1,127; ansic: 736; sh: 420; makefile: 103
file content (14 lines) | stat: -rwxr-xr-x 285 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env runawk

#use "has_prefix.awk"

# This demo checks if $1 has a prefix $2

# Input files for this demo: examples/demo_has_prefix.in*

{
	if (has_prefix($1, $2))
		printf "yes, `%s' begins with `%s'\n", $1, $2
	else
		printf "no, `%s' does not begin with `%s'\n", $1, $2
}