The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
grep unix.com with google



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-01-2009
Registered User
 

Join Date: Nov 2009
Location: India - Chennai
Posts: 7
How to create a file with full permission in unix script

In my script, I am creating a file ----> then writting one line (i.e. Timestamp) ----> then FTP'ing. The same script can be executed by many other users.
While other users executing this script, they couldn't Over write this one line (i.e. Timestamp)

My expectation
So I wanted to create a file with full permission(_rwxrwxrwx). Not by chmod.

Code

Code:
dt=`date +%m_%d_%y`
Tablename=$1

Filename=$Tablename"_"$dt.dmp
FlgFile=$Tablename.flg
 
echo $Filename > $FlgFile
chmod 777 $FlgFile

Error
When other user executing this script they are getting an error chmod: changing permissions of .FlgFile. "Operation not permitted"

Thanks in advance
sbmk

Last edited by pludi; 12-01-2009 at 05:36 PM.. Reason: code tags, please...
  #2 (permalink)  
Old 12-01-2009
Registered User
 

Join Date: May 2008
Location: Chennai
Posts: 43
You can set umask 000 for the dir where the file will be created.
  #3 (permalink)  
Old 12-01-2009
Registered User
 

Join Date: Jun 2006
Posts: 468
If your colleagues and you are in same unix group, umask 002 is enough.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX file Permission puspendu.das.in UNIX for Advanced & Expert Users 2 11-20-2009 06:32 AM
FTP Files should get full permission vfrg Shell Programming and Scripting 1 10-22-2009 09:18 AM
How to create xls file using unix script raghu.iv85 Shell Programming and Scripting 3 04-07-2009 03:18 AM
How to create file in ksh scripting with permission(rw-rw-rw) mansa Shell Programming and Scripting 1 11-16-2008 07:39 AM
need a unix script to let me know by email or pager when the filesystem is 80% full. jzjy0r UNIX for Dummies Questions & Answers 1 05-16-2002 06:04 PM



All times are GMT -4. The time now is 11:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0