Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-03-2010, 10:10 AM   #1
Registered: Dec 2008
Posts: 61

Rep: Reputation: 17
permission problems in script

Problem with the script :

echo "************* Bill Printing Extraction Proces *************"

UIDPWD=`cat $MEDT_HOME/restrict/$ORACLE_SID` export UIDPWD

when we use the above,

file is being generated with the below permissions :

-rw-rw---- 1 MEDB dba 213954 Feb 23 13:23 medt-21022010.txt

When we write UIDPWD as hardcode like below:


It extracts files with read permission for OTHER so we can FTP.
-rw-r--r-- 1 MEDB dba 213954 Feb 23 14:23 medt-21022010.txt

We need to run it with no hardcode for UIDPWD and file should have read permission.What am missing here ?

Old 03-03-2010, 10:14 AM   #2
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381Reputation: 2381

Set this as one of the first lines in your script after the hasbang: umask 022

Hope this helps.
Old 03-03-2010, 10:15 AM   #3
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
put chmod 644 *.txt in your script ?
Old 03-03-2010, 10:58 AM   #4
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian except for netbook still on Slackware 13.37 (and I have to support Ubuntu)
Posts: 8,572
Blog Entries: 30

Rep: Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182
Hi Kai

The quoted code does not create any files, it simply envalues a variable with the contents of a file and exports it.

How is the file created? Specifically, how is $UIDPWD passed into the command that creates the file?


permission, umask

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission denied executing cgi-script Geminias Linux - Networking 4 07-31-2006 10:02 PM
Shell Script with Root Permission gjagadish Linux - Security 2 02-15-2006 08:38 AM
PHP script permission problem deadlock Linux - Newbie 8 01-11-2006 06:34 AM
Permission change script lluciano Programming 1 10-17-2005 11:39 AM
permission denied when executing my own script Red Squirrel Linux - Newbie 3 03-07-2004 08:21 PM

All times are GMT -5. The time now is 01:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration