Sponsored Content
Operating Systems Solaris Need help on a Script in Solaris Post 302726225 by marcus5 on Sunday 4th of November 2012 01:54:01 AM
Old 11-04-2012
Error Need help on a Script in Solaris

[Using Solaris 10]

Ok here's the situation, i need to create a script in terminal that checks that the default umask is set to 025. If it is indeed set to 025, the script should echo "Exception: No"

If it is not set to 025, the script should echo "Exception: Yes"

How do i go about doing it? I'm new to this and the closest thing i can get to printing out the umask is cat /etc/default/login | grep UMASK but that isn't enough. I know i can try to use if else to compare it but i can't get it to work. Any help?

Plus i am using bash, full admin permissions(root)

Many thanks.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

scheduling script to run another script on Solaris

Hi everyone, I am trying to automate one process on Solaris OS. This is what happens at the moment. Every night at 19:30 and every hour after that we run a script that checks the status of databases. That script runs and prints if db's are OK at the end it states how many were down. I am... (3 Replies)
Discussion started by: andrei
3 Replies

2. Shell Programming and Scripting

[Help] startup script on solaris 8

hi experts, i have some problem with my solaris 8 v890 server, is : the server running process called SS7 below is example process : PID STAT MODE HOST MUX OBJECT 384 ok LX|A USSDGmdn-1a spm/0 daemon 385 ok LX|A USSDGmdn-1a spm/2 ... (0 Replies)
Discussion started by: bucci
0 Replies

3. Solaris

boot up script in solaris 10

Hi I'd like to add a start up script to run at boot time.I think that pre solaris 10 you'd add it to /etc/init.d. But I'm using Solaris 10 now and it has this SMF config thing which I'm not sure whether I have to add a service to it or not. Does anyone know how add a script at boot time on... (2 Replies)
Discussion started by: fishman2001
2 Replies

4. Shell Programming and Scripting

Solaris request script

Hi, In the request script I need to read user input and store to variable to use it later in postinstall script. e.g. LOGDIR=/app/log echo "Please type the Log Directory : (current value: $LOGDIR)" read LOGDIR When asked, if the user enters a value the parameter is ok and I... (2 Replies)
Discussion started by: potro
2 Replies

5. Shell Programming and Scripting

simple script in solaris

i am using SunOS ReportServer 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Blade-2500 and i just wrote a simple script like below: #!/sbin/sh df -k exit 0 when i run it i get response as below check.sh: not found please what am i doing wrong (7 Replies)
Discussion started by: tomjones
7 Replies

6. Shell Programming and Scripting

Bourn script on solaris 9

Hello Everyone I need a bourn script that allow the users to enter any network address from (172.21.2.1 - 172.21.2.24) . more explanation : the script should add entries (ip address&hostname) to the hosts file , so i can ping to another computer using the hostname . the host file will be... (3 Replies)
Discussion started by: Ra@ed
3 Replies

7. Shell Programming and Scripting

Perl Script on Solaris and HP UX

Dear All, I am having the Perl script which is using Sudo and it is having a lot of sub programs. The main task of script is to create create the unix user account and database accounts. Previous version of platform was Sun Solaris, and now are moving to HP UX. I am posting this, to know... (14 Replies)
Discussion started by: yadavricky
14 Replies

8. Solaris

Need to execute the script with script name wihtout using ./scriptname in Solaris 10

Hi, I am using solaris 10.Is there any way to execute the script with the scriptname wihtoug using ./scriptname?Also does it varies from shell to shell.I have scripts in bash,ksh,sh shells. Example:script.sh is the script name.I need to execute the script like this script.sh instead... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

9. Solaris

Script on Solaris spawning 2 processes for one shell script execution

Hi, I am having a shell script on Solaris 10 which has a while loop as shown below. #!/usr/bin/ksh # while do sleep 60 done Name of the shell script is coldcentric.sh. I executed script /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh from a command task in Informatica worklow as... (3 Replies)
Discussion started by: chekusi
3 Replies
UMASK(2)						     Linux Programmer's Manual							  UMASK(2)

NAME
umask - set file mode creation mask SYNOPSIS
#include <sys/types.h> #include <sys/stat.h> mode_t umask(mode_t mask); DESCRIPTION
umask() sets the calling process's file mode creation mask (umask) to mask & 0777 (i.e., only the file permission bits of mask are used), and returns the previous value of the mask. The umask is used by open(2), mkdir(2), and other system calls that create files to modify the permissions placed on newly created files or directories. Specifically, permissions in the umask are turned off from the mode argument to open(2) and mkdir(2). The constants that should be used to specify mask are described under stat(2). The typical default value for the process umask is S_IWGRP | S_IWOTH (octal 022). In the usual case where the mode argument to open(2) is specified as: S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH (octal 0666) when creating a new file, the permissions on the resulting file will be: S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH (because 0666 & ~022 = 0644; i.e., rw-r--r--). RETURN VALUE
This system call always succeeds and the previous value of the mask is returned. CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001. NOTES
A child process created via fork(2) inherits its parent's umask. The umask is left unchanged by execve(2). The umask setting also affects the permissions assigned to POSIX IPC objects (mq_open(3), sem_open(3), shm_open(3)), FIFOs (mkfifo(3)), and UNIX domain sockets (unix(7)) created by the process. The umask does not affect the permissions assigned to System V IPC objects created by the process (using msgget(2), semget(2), shmget(2)). SEE ALSO
chmod(2), mkdir(2), open(2), stat(2), acl(5) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2008-01-09 UMASK(2)
All times are GMT -4. The time now is 10:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy