?? giveaccessauth.sh
字號:
#!/bin/ksh## SAMPLE NAME: giveAccessAuth## FUNCTIONS: This sample shell script lists the users who have the authority# to give other users access to a specified component.## USAGE: giveAccessAuth componentName## ENVIRONMENT# VARIABLE(S): CMVC_FAMILY [CMVC_BECOME]## 5765-207 (C) COPYRIGHT International Business Machines Corp. 1993,1994# 5765-202 (C) COPYRIGHT International Business Machines Corp. 1993,1994# 5622-063 (C) COPYRIGHT International Business Machines Corp. 1993,1994# 5765-397 (C) COPYRIGHT International Business Machines Corp. 1994# All Rights Reserved# Licensed Materials - Property of IBM## US Government Users Restricted Rights - Use, duplication or# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.### NOTICE TO USERS OF THE SOURCE CODE EXAMPLES## INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THE SOURCE CODE# EXAMPLES, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, "AS IS" WITHOUT# WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT# LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A# PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE# OF THE SOURCE CODE EXAMPLES, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS,# IS WITH YOU. SHOULD ANY PART OF THE SOURCE CODE EXAMPLES PROVE# DEFECTIVE, YOU (AND NOT IBM OR AN AUTHORIZED RISC System/6000* WORKSTATION# DEALER) ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR# CORRECTION.## * RISC System/6000 is a trademark of International Business Machines# Corporation.## /usr/lpp/cmvc/samples/giveAccessAuth#if [ $# -eq 0 ]; then echo "\nusage: $0 componentName\n" echo "This sample shell script lists the users who have the authority" echo "to give other users access to a specified component.\n" exit 1fiif [ -z "$CMVC_FAMILY" ]then echo "The CMVC family must be set with the CMVC_FAMILY environment variable." exit 1ficomp=$1count=0Report -view CompView -wh "name='$comp'" -raw >/tmp/cv$$while read linedo COMPNAME=`echo $line | cut -d'|' -f1 ` count=1done </tmp/cv$$if [ $count -ne 1 ]then echo "\nThe component, $comp, does not exist in the specified family.\n" exit 1fiecho "\nThe following people can give you access:\n"Report -view CompView -w "name='$comp'" -raw |sort -t"|" +1 -2 |awk -F"|" '{ printf "%-15s %s\n",$2,"Component owner"}END { printf "\n"}'Report -view AccessView -raw -where " \ authorityName in (select name from Authority \ where action='AccessCreate') and \ compName='$comp' and \ authorityType <> 'restricted'" | \sort -t"|" +1 -2 | \awk -F"|" '{ if ($1 == "'$comp'") printf "%-15s %s\n",\ $2,"Explicit AccessCreate capability at this component"}'Report -view Users -w "superUser='yes'" -raw |sort -t"|" +0 -1 |awk -F"|" ' BEGIN { printf "\n" }{ printf "%-15s %s\n",$1,"Super user"}END { printf "\n"}'exit# end of file
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -