Getting warning message while creating a file thru script

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getting warning message while creating a file thru script
# 1  
Old 07-07-2011
Getting warning message while creating a file thru script

I have a script, it will create 3 files

echo "0" > $file3

For file1 and file2 we are not initializing any values.

But for file3 we are initializing the value of 0.

When we execute the script. file1 and file2 are created with chmod 664 permission.

But the file3 is created with chmod 644 permission.

The file3 has to be created with chmod 664 permission. So we have tried by giving the following code.


echo "0" > $file3
chmod 664 $file3

If I execute the script, I am not getting any warning message. If the script is executed by some other id, we are getting the warning message "chmod:dataout/file3.txt: not owner".

Can anyone help me to fix this issue.

Krishnakanth Manivannan
# 2  
Old 07-07-2011
is other users are in same group ?
# 3  
Old 07-07-2011

One more thing.. how come file1 and file2 are having chmod 664 permission and file3 alone is having chmod 644 permission when executing the script.

Krishnakanth Manivannan
# 4  
Old 07-07-2011
chmod -f 664 $file3
This User Gave Thanks to ltomuno For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in creating file restoration script from a backup script.

Hi all i am struggling in creating a restore of env files while doing applications clone. the first file i created for copying the important configurations file which is running perfect now for reverting the changes i mean when i am restoring these files to its original places i have to do... (7 Replies)
Discussion started by: javeedkaleem
7 Replies

2. Shell Programming and Scripting

Shell script to run command + compare values and post a warning message.

Hi all, I am trying to create shell script to run command then compare values with rule set for every 5 seconds and post a warning message if the compared value meet the rules. -the script is related to Oracle/Sun product messaging server 6.2 1) command that need to be run to gather... (2 Replies)
Discussion started by: Mr_47
2 Replies

3. Shell Programming and Scripting

KSH - help needed for creating a script to generate xml file from text file

Dear Members, I have a table in Oracle DB and one of its column name is INFO which has data in text format which we need to fetch in a script and create an xml file of a new table from the input. The contents of a single cell of INFO column is like: Area:app - aam Clean Up Criteria:... (0 Replies)
Discussion started by: Yoodit
0 Replies

4. Programming

creating a message queue using mq_open

Hi all, First of all thanks in advance for reading my post and for your heart for helping me. I am trying to create a message queue using mq_open(name,oflags,mode_t,attr) method. But that function call is returning with an error code EFAULT. By googling it I found that it happens when there is... (10 Replies)
Discussion started by: parusasi
10 Replies

5. Programming

Permission denied when creating message queue

Hi guys. i have wrote a simple program to test message queue attributes. here it is: #include <stdio.h> #include <stdlib.h> #include <mqueue.h> #include <fcntl.h> #include <string.h> #include <errno.h> #include <sys/stat.h> int main() { struct mq_attr attr; mqd_t mqd; ... (2 Replies)
Discussion started by: majid.merkava
2 Replies

6. Programming

Creating 3 process and piping a message

sorry im very new to this but i am supposed to create 3 processes A,B, and C and have a direct link from a to b, b to c, and c to a. here is my code. It does work, however if you look at what I bolded as long as my final read is p it seems to always work, regardless of the bolded section. ... (6 Replies)
Discussion started by: p00ndawg
6 Replies

7. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

8. Programming

URGENT:::Can anybody help me in creating message queue appliction??

hello, I had to implement a message queue application....between 30 processes...... all 30 proceses are getting data from serial port.... And here is THE FLOW::::::::1 connector process...which is linked with message queue to all the 30 applications. Processes get the data from serial port and... (9 Replies)
Discussion started by: arunchaudhary19
9 Replies

9. Filesystems, Disks and Memory

Warning Message.

I have had trouble with my PC, due to construction failure I from my dealer or a power-blast over the net I had a broken MotherBoard, CPU and Memory, So I had to get new ones. Now I'm having a 2000Mhz CPU an ASUS P4S... {I think it's P4S500} and new DDR- memory My PC gives a warning-message... (3 Replies)
Discussion started by: Silver
3 Replies
Login or Register to Ask a Question