Sponsored Content
Full Discussion: UNIX Scripting
Top Forums Shell Programming and Scripting UNIX Scripting Post 302887800 by Don Cragun on Monday 10th of February 2014 10:51:49 PM
Old 02-10-2014
Quote:
Originally Posted by sea
(afaik)
Code:
egrep -A1  "^machine" script.txt > outputfile

should be the same as:
Code:
grep -e -A1  "^machine" script.txt > outputfile

You missed the -A1, as well as there is no need for [ICODE]cat[/ICODE] Smilie

Hope this helps
Almost...
Code:
egrep ...

is the same as:
Code:
grep -E

on systems that both have egrep (which is now obsolescent) and have a -E option in grep (which some very old versions do not have).
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX Scripting

:confused: I need to find a place or places on the Internet where I can find UNIX scripts to view and to modify to make life easy on the UNIX environment. Can someone help me on this. Thanks (7 Replies)
Discussion started by: wolf
7 Replies

2. UNIX for Dummies Questions & Answers

Help With Unix Scripting.

Can anybody tell me the best way to learn unix scripting.can you recommend a good book.Please help! (1 Reply)
Discussion started by: hella
1 Replies

3. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

4. UNIX for Dummies Questions & Answers

Unix scripting pl help

Hi All, I am new to Unix Scripting. I have below scenario. I need to write a Unix function with the following. 1. I have table. From this table I need to write a query. SELECT Col1(File_nm),Col2(From_Loc),Col3(To_Loc) FROM A WHERE CONDITION For... (1 Reply)
Discussion started by: sree11
1 Replies

5. UNIX for Dummies Questions & Answers

Unix Scripting

Hi Gurus, I am a system admin in solaris field and ive planned to study unix scripting.ive planned to start reading Mastering Unix scripting by randal.Scripts in that are based on Korn shell(ksh).my question is whether the same scripts can be applied to other shells like bash etc..And... (1 Reply)
Discussion started by: madanmeer
1 Replies

6. Shell Programming and Scripting

Unix Scripting

Hi Gurus, I am a system admin in solaris field and ive planned to study unix scripting.ive planned to start reading Mastering Unix scripting by randal.Scripts in that are based on Korn shell(ksh).my question is whether the same scripts can be applied to other shells like bash etc..And... (4 Replies)
Discussion started by: madanmeer
4 Replies

7. Shell Programming and Scripting

Unix scripting

how to check if a unix script gets executed without errors across all unix platforms. incase if a script gets executed without errors only one platform say AIX, what needs to be done to that script such that it will run all unix platforms like linux, hp, sun etc (2 Replies)
Discussion started by: rmann
2 Replies

8. UNIX for Advanced & Expert Users

Unix scripting

i need help with this problem this is the problem: Write a script that logs how many users login on/off the system over a 5 minute period. It can run in the foreground, and run 4 times a minute. Set a trap that will not allow a CNTRL-C command, and if a CNTRL-C is excuted store the time and date... (1 Reply)
Discussion started by: sportsmansixty6
1 Replies

9. UNIX for Dummies Questions & Answers

Unix Shell Scripting( Calling from Unix to PLSQL)

Hello Experts, I have the following questions to be discussed here at this esteemed discussion forum. I have two Excel sheets which contain Unix Commands llike creating directory the structure/ftp/Copy/Zip etc to basically create an environment. I need help in understanding some of... (1 Reply)
Discussion started by: faizsaadq
1 Replies

10. Shell Programming and Scripting

UNIX scripting

LIST=/home/xxxxxxx/ABC/xeeno_scrpts/temp/tempfile ERRORDIR=/home/xxxxxxx/ABC/error_directory EMAILFILE=/home/xxxxxxx/ABC/xeeno_scrpts/temp/emailfile echo "There were errors in the following report file for Xeenos:" > $EMAILFILE echo >> $EMAILFILE echo "This files have been moved to... (9 Replies)
Discussion started by: bcarosi
9 Replies
PTS_CHOWN(1)						       AFS Command Reference						      PTS_CHOWN(1)

NAME
pts_chown - Changes the owner of a Protection Database entry SYNOPSIS
pts chown -name <group name> -owner <new owner> [-cell <cell name>] [-noauth] [-localauth] [-force] [-help] pts cho -na <group name> -o <new owner> [-c <cell name>] [-no] [-l] [-f] [-h] DESCRIPTION
The pts chown command designates the user or group named by the -owner argument as the owner of the group named by the -name argument, and records the new owner in the owner field of the group's Protection Database entry. In the case of regular groups, this command automatically changes the group name's owner prefix (the part of the group name before the colon) to match the new owner. If the new owner is itself a group, then only its owner prefix, not its complete name, becomes the owner prefix in the new name. The change to the owner prefix does not propagate to any groups owned by the group, however. To make the owner prefix of such group-owned groups reflect the new owning group, use the pts rename command. It is not possible to change a user or machine entry's owner from the default set at creation time, the system:administrators group. CAUTIONS
While designating a machine as a group's owner does not cause an error, it is not recommended. The Protection Server does not extend the usual privileges of group ownership to users logged onto the machine. OPTIONS
-name <group name> Specifies the current name of the group to which to assign a new owner. -owner <new owner> Names the user or group to become the group's owner. -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). EXAMPLES
The following example changes the owner of the group "terry:friends" from the user "terry" to the user "pat". A side effect is that the group name changes to "pat:friends". % pts chown -name terry:friends -owner pat The following example changes the owner of the group "terry:friends" from the user "terry" to the group "pat:buddies". A side effect is that the group name changes to "pat:friends". % pts chown -name terry:friends -owner pat:buddies PRIVILEGE REQUIRED
The issuer must belong to the system:administrators group or currently own the group. SEE ALSO
pts(1), pts_rename(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2014-04-08 PTS_CHOWN(1)
All times are GMT -4. The time now is 05:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy