File: ccs-domainmatch

package info (click to toggle)
ccstools 1.7.2-20100401-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 984 kB
  • ctags: 1,080
  • sloc: ansic: 20,286; sh: 890; makefile: 80
file content (16 lines) | stat: -rwxr-xr-x 591 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /bin/sh
#
# fgrep for domain /proc/ccs/domain_policy .
#
# Copyright (C) 2005-2009  NTT DATA CORPORATION
#
# Version: 1.7.0   2009/09/03
#
# Usage: ccs-domainmatch string_to_find
#
# Example: ccs-domainmatch /etc/fstab
#

awk -v STR="$1" -- ' BEGIN { flag = 0; } { if ( $1 == "<kernel>" ) { domain = $0; flag = 0; } else if (index($0, STR) > 0) { if (flag == 0) { print ""; print domain; } flag = 1; print $0; } } ' /proc/ccs/domain_policy 

#awk -v STR="$1" -- ' { if ( $1 == "<kernel>" ) domain = $0; else if (index($0, STR) > 0) { print domain; print $0; } } ' /proc/ccs/domain_policy