qse/ase/test/awk/t28.awk

41 lines
691 B
Awk
Raw Normal View History

2006-09-01 16:31:13 +00:00
#global xyz;
2006-08-20 15:49:48 +00:00
2006-08-13 06:33:30 +00:00
END {
2006-09-01 16:31:13 +00:00
#local xyz;
2006-08-20 15:49:48 +00:00
2006-08-13 06:33:30 +00:00
print index ("abc", "abc");
print index ("abc", "b");
2006-08-13 16:05:04 +00:00
print index ("abc", "kabc");
print "----------------------------";
print substr ("abc", "abcdefg", 5);
print substr ("abc", -1, 5);
print substr ("abc", 0, 5);
print substr ("abc", 1, 5);
print substr ("abc", 2.829, 5);
print substr ("abc", "3", 5);
print substr ("abc", 4, 5);
2006-08-17 03:49:30 +00:00
/*
2006-08-13 16:05:04 +00:00
a[1] = 20;
substr (a, 3, 4);
2006-08-17 03:49:30 +00:00
*/
print tolower ("AbcDEF");
print toupper ("AbcDEF");
2006-08-17 14:10:21 +00:00
arr[0] = "xxx";
2006-09-01 16:31:13 +00:00
#print split ("abc def abc", arr);
print split ("abc def kkk", j);
2006-08-20 15:49:48 +00:00
2006-09-01 16:31:13 +00:00
#xyz = 20;
#print xyz;
print split ("abc def kkk", ((xyz)));
#for (i in arr)
2006-08-20 15:49:48 +00:00
for (i in xyz)
2006-08-17 14:10:21 +00:00
{
2006-08-20 15:49:48 +00:00
print i, " ", xyz[i];
2006-08-17 14:10:21 +00:00
}
2006-08-13 06:33:30 +00:00
}