Sponsored Content
Full Discussion: "Global" profiles?
Top Forums UNIX for Dummies Questions & Answers "Global" profiles? Post 91509 by blowtorch on Friday 2nd of December 2005 10:18:25 PM
Old 12-02-2005
There is a provision in ksh that allows you to set readonly variables. You can use the command typeset with the '-r' option to do so. I do not know if this can be used in this case, I am just providing you with an option that you could try out.

Also, the file is not /etc/.profile, it is /etc/profile.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

"ap" command not dumping user profiles

System = SCO UnixWare 7.1.1 Using the following command... ap -dgv > users.ap ... I should be able to dump all 250 user profiles to the file "users.ap" and display the results for each account as it is added to the file. The problem is that I only get the following output: UX:ap: INFO:... (0 Replies)
Discussion started by: rm -r *
0 Replies

2. Shell Programming and Scripting

AWK -> getting "global" vars

Hello, presently, I'm calling nawk from my main script and have nawk defined in one file. So I call nawk like this nawk -f file input This file defines how to separate mails in /var/mail/$user and show 1 at a time. However, I would also like to do other actions (delete message, forward... (9 Replies)
Discussion started by: petoSVK
9 Replies

3. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. UNIX for Dummies Questions & Answers

How to Export Glance "Global System Calls" data to a file

Hello... I'm trying to setup a cronjob to record system data using glance at certain times of the day. My question is, how would one export the "Global System Calls" information to a file? Below is the command I have been using and it works to export CPU information. glance -f ... (0 Replies)
Discussion started by: fumus
0 Replies

6. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
readonly(1)							   User Commands						       readonly(1)

NAME
readonly - shell built-in function to protect the value of the given variable from reassignment SYNOPSIS
sh readonly [name]... ksh **readonly [name [= value]]... **readonly -p ksh93 ++readonly [-p] [name [= value]]... DESCRIPTION
sh The given names are marked readonly and the values of the these names may not be changed by subsequent assignment. If no arguments are given, a list of all readonly names is printed. ksh The given names are marked readonly and these names cannot be changed by subsequent assignment. When -p is specified, readonly writes to the standard output the names and values of all read-only variables, in the following format: "readonly %s=%s ", name, value if name is set, and: "readonly $s ", name if name is unset. The shell formats the output, including the proper use of quoting, so that it is suitable for reinput to the shell as commands that achieve the same value and readonly attribute-setting results in a shell execution environment in which: 1. Variables with values set at the time they were output do not have the readonly attribute set. 2. Variables that were unset at the time they were output do not have a value at the time at which the saved output is re-input to the shell. On this manual page, ksh(1) commands that are preceded by one or two ** (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a variable assignment. This means that tilde substitution is performed after the = sign and word splitting and file name genera- tion are not performed. ksh93 readonly sets the readonly attribute on each of the variables specified by name which prevents their values from being changed. If =value is specified, the variable name is set to value before the variable is made readonly. If no names are specified then the names and values of all readonly variables are written to standard output. readonly is built-in to the shell as a declaration command so that field splitting and pathname expansion are not performed on the argu- ments. Tilde expansion occurs on value. -p Causes the output to be in a form of readonly commands that can be used as input to the shell to recreate the current set of readonly variables. On this manual page, ksh93(1) commands that are preceded by one or two + symbols are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. They are not valid function names. 5. Words, following a command preceded by ++ that are in the format of a variable assignment, are expanded with the same rules as a variable assignment. This means that tilde substitution is performed after the = sign and field splitting and file name genera- tion are not performed. EXIT STATUS
ksh93 The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ksh(1), ksh93(1), sh(1), typeset(1), attributes(5) SunOS 5.11 2 Nov 2007 readonly(1)
All times are GMT -4. The time now is 03:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy