Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Update text files in place (string substitution) ?? Post 3994 by kornshellmaven on Monday 16th of July 2001 09:18:31 PM
Old 07-16-2001
Question Update text files in place (string substitution) ??

The auditors have nailed us for world writeable files....

Apparently in years gone by, quite a number of our kornshell scripts have had:
umask 000 put in the script.

We have been able to turn off world writeable for existing dirs & files, but as these scripts run, new files keep getting created.

I used a utility many years ago which would do a string substitution within a series of files.
I would like to unilaterally comment out all umask commands within all of our scripts without having to modify them 1 at a time.

Running under Sun Solaris 7.

Any ideas out there?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep a string from 2 text files

How to grep a string in two different files, I am having the following scenario TextFile1 Date (dd/mm)Time Server IP Error Code =========================================================================== 10/04/2008 10:10 ServerA xxx.xxx.xxx.xxx ... (15 Replies)
Discussion started by: karthikn7974
15 Replies

2. UNIX for Dummies Questions & Answers

String Search within Text Files

I have many scripts in directories and sub-directories that I would like to search for a specific string. How would I do that? (1 Reply)
Discussion started by: bggibson
1 Replies

3. Shell Programming and Scripting

How to insert a string in a file at specified place?

Hi all, I want to insert a string in a specified place of a very large file. I am giving an example of the task: I love football. Above is a sentence in a file and I want to insert a string "the" between love and football. It is not sure that where this particular line exists. It has to... (4 Replies)
Discussion started by: naw_deepak
4 Replies

4. Shell Programming and Scripting

Perl - Enter text in a file in a place.

Hi, I have a simple question: I need to enter some text in a text file at a certain place via perl. I would first need to find that specific text in the file and then I would like to insert a line after that particular line. Say I have this text file: I am a great Perl Programmer I... (1 Reply)
Discussion started by: som.nitk
1 Replies

5. Shell Programming and Scripting

Find a string and place two blank lines

Hi friends, I am looking for a line to find a particular string in my file and once found then replace with 2-3 blank lines before the string Example: aaa 11 bbb 1 2 3 aaa 22 bbb 4 5 6 Output (4 Replies)
Discussion started by: shaliniyadav
4 Replies

6. Shell Programming and Scripting

Take input from read and place it a string in another file

Hi, This is most likely a dumb question but I could not find answer to it elsewhere. I'm building a simple menu with case /esac and want to read user's input: Please enter XYZ ; read XYZ How do I take the value of XYZ and insert it as a variable $XYZ in file file.txt ? I may need to... (9 Replies)
Discussion started by: svetoslav_sj
9 Replies

7. Shell Programming and Scripting

Place , character after 3 digits from left to right in a string

Hi All, Could anyone please help me, how to put ‘,' character after 3 digits from right to left count,among 17 digits sting. unix scripting Example - I am having 12345678911234567 digits Accepted result-- 12,345,678,911,234,567 Note- 12345678911234567 digits will be dynamic at run time, I... (13 Replies)
Discussion started by: krupasindhu18
13 Replies

8. Shell Programming and Scripting

How to update field value in place?

Dear all: I have a file: 1:00 2:abc 3:12asweand I ran the following awk script on this file: #!/usr/bin/awk -f { i= 1; while(i<=NF) { $i=substr($i, 1, index($i, ":")-1); i++ } }I am expecting the file would become (after running... (7 Replies)
Discussion started by: littlewenwen
7 Replies

9. Shell Programming and Scripting

Cut text file in place

I have a file that i want to take only the first part of it and discard the rest, to be accurate,I need the first 137097 lines but I cant use split because I dont have enough space on my disck. I need sth to cut the file in its place (3 Replies)
Discussion started by: Heidi Heweidy
3 Replies

10. Shell Programming and Scripting

Need to merge multiple text files vertically and place comma between fields

Hello expert friends, I'm writing a script to capture stats using sar and stuck up at report generation. I have around 10 files in a directory and need to merge them all vertically based on the time value of first column (output file should have only one time value) and insert comma after... (6 Replies)
Discussion started by: prvnrk
6 Replies
exec_attr(4)                                                                                                                          exec_attr(4)

NAME
exec_attr - execution profiles database SYNOPSIS
/etc/security/exec_attr /etc/security/exec_attr is a local database that specifies the execution attributes associated with profiles. The exec_attr file can be used with other sources for execution profiles, including the exec_attr NIS map and NIS+ table. Programs use the getexecattr(3SECDB) rou- tines to access this information. The search order for multiple execution profile sources is specified in the /etc/nsswitch.conf file, as described in the nsswitch.conf(4) man page. The search order follows the entry for prof_attr(4). A profile is a logical grouping of authorizations and commands that is interpreted by a profile shell to form a secure execution environ- ment. The shells that interpret profiles are pfcsh, pfksh, and pfsh. See the pfsh(1) man page. Each user's account is assigned zero or more profiles in the user_attr(4) database file. Each entry in the exec_attr database consists of one line of text containing seven fields separated by colons (:). Line continuations using the backslash (fR) character are permitted. The basic format of each entry is: name:policy:type:res1:res2:id:attr name The name of the profile. Profile names are case-sensitive. policy The security policy that is associated with the profile entry. The valid policies are suser (standard Solaris superuser) and solaris. The solaris policy recognizes privileges (see privileges(5)); the suser policy does not. The solaris and suser policies can coexist in the same exec_attr database, so that Solaris releases prior to the current release can use the suser policy and the current Solaris release can use a solaris policy. solaris is a superset of suser; it allows you to specify privileges in addition to UIDs. Policies that are specific to the current release of Solaris or that contain privileges should use solaris. Policies that use UIDs only or that are not specific to the current Solaris release should use suser. type The type of object defined in the profile. The only valid type is cmd. res1 Reserved for future use. res2 Reserved for future use. id A string that uniquely identifies the object described by the profile. For a profile of type cmd, the id is either the full path to the command or the asterisk (*) symbol, which is used to allow all commands. An asterisk that replaces the filename component in a pathname indicates all files in a particular directory. To specify arguments, the pathname should point to a shell script that is written to execute the command with the desired argument. In a Bourne shell, the effective UID is reset to the real UID of the process when the effective UID is less than 100 and not equal to the real UID. Depending on the euid and egid values, Bourne shell limitations might make other shells preferable. To prevent the effective UIDs from being reset to real UIDs, you can start the script with the -p option. #!/bin/sh -p attr An optional list of semicolon-separated (;) key-value pairs that describe the security attributes to apply to the object upon execu- tion. Zero or more keys may be specified. The list of valid key words depends on the policy enforced. The following key words are valid: euid, uid, egid, gid, privs, and limitprivs. euid and uid contain a single user name or a numeric user ID. Commands designated with euid run with the effective UID indicated, which is similar to setting the setuid bit on an executable file. Commands designated with uid run with both the real and effective UIDs. Setting uid may be more appropriate than setting the euid on privileged shell scripts. egid and gid contain a single group name or a numeric group ID. Commands designated with egid run with the effective GID indicated, which is similar to setting the setgid bit on a file. Commands designated with gid run with both the real and effective GIDs. Setting gid may be more appropriate than setting guid on privileged shell scripts. privs contains a privilege set which will be added to the inheritable set prior to running the command. limitprivs contains a privilege set which will be assigned to the limit set prior to running the command. privs and limitprivs are only valid for the solaris policy. Example 1: Using Effective User ID The following example shows the audit command specified in the Audit Control profile to execute with an effective user ID of root(0): Audit Control:suser:cmd:::/usr/sbin/audit:euid=0 /etc/nsswitch.conf /etc/user_attr /etc/security/exec_attr CAVEATS
When deciding which authorization source to use (see ), keep in mind that NIS+ provides stronger authentication than NIS. Because the list of legal keys is likely to expand, any code that parses this database must be written to ignore unknown key-value pairs without error. When any new keywords are created, the names should be prefixed with a unique string, such as the company's stock symbol, to avoid potential naming conflicts. The following characters are used in describing the database format and must be escaped with a backslash if used as data: colon (:), semi- colon (;), equals (=), and backslash (fR). auths(1), profiles(1), roles(1), sh(1), makedbm(1M), getauthattr(3SECDB), getauusernam(3BSM), getexecattr(3SECDB), getprofattr(3SECDB), getuserattr(3SECDB), kva_match(3SECDB), auth_attr(4), prof_attr(4), user_attr(4), privileges(5) 25 Feb 2005 exec_attr(4)
All times are GMT -4. The time now is 05:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy