how to change mod of files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to change mod of files
# 1  
Old 03-19-2006
how to change mod of files

hi everyone
I have a directory /usr5/sch.
The shell is /bin/csh/. In this directory, I have a script called cs-claims-tst that runs an object cobol that going over a few other directory and open files and inserting them to d.b!
If i run this script from its current directory, it works o.k, but
I have another directory /usr2/hafala.

And i did like this:
cd /usr2/hafala
ln -s /usr5/sch/cs-claims-tst

When I run the script in this directory, (shell(/bin/csh)) it's not open my directories unless I will do chmod 777 for the files in all the directories (something like 20).

My question is, why doesn't he recognized it
My second problem: if there is not solution for this problem that means
that I need to go to account call manager and do chmod 777 for the directories from their and i don't know how to do this because the shell
in the manager is /usr/bin/ksh.

please someone help me to solve the problem
thank's a lot

Last edited by RTM; 03-22-2006 at 03:25 AM.. Reason: Formatting to be able to read it
# 2  
Old 03-22-2006
First, post what userid you are using (found with "id" command). Then post the output of the following commands:

ls -ld /usr2/hafala
ls -ld /usr2/sch

Your issue may be as simple as requiring read permissions versus setting all files to 777 (which is read, write, execute).

Also, the chmod command works the same in ksh and csh.
# 3  
Old 03-22-2006
Link Name?

It appears as though you're not using the link command correctly, i.e. you need to specify a link name e.g.:

ln -s /file_to_link name - where name is name of link!

Good luck!

Smilie
# 4  
Old 03-22-2006
mr-synapse,

Actually, if you don't put the last parameter, it names the link the same as the physical file. (I thought the same thing - so I tried it - it was the 'new lesson' for the other day)
# 5  
Old 03-23-2006
hi everyone
thanks for your answers!

doing like this ls -ld /usr5/sch
drwxrwxrwx 13 sch other 151552 Mar 23 13:24 /usr5/sch

ls -ld /usr2/hafala
drwxrwxrwx 3 hafala other 10240 Mar 22 14:23 /usr2/acct/hafala

it's very strange because when i'm creating files in /usr2/hafala
the group is ext_cust

When i did id in both directories i got something like this
uid=245(sch) gid=1(other)

however i know what is chmod and i know all the options but
when i did the link it's just dont open the files until i will do chmod commnd which if i need to do it i want that it will be part of the script that i'm running

how to do it (maybe with rlogin to the user that i can chng the mod?)
maybe i should do a hard link ?
please help me here ?

Last edited by RTM; 04-23-2006 at 11:55 AM..
# 6  
Old 03-30-2006
hi every one
did someone fond a solution to my problem
please help me here
# 7  
Old 04-23-2006
maybe there is a way to connect with the
su - user/passwd
or should i try it with rlogin
please help !!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Alert when files change

The code I created monitors directories, files and reports when it has changed. It saves the md5sums of the files it is monitoring and sends alert whenever any files change. It sends an excel report to admin. My code is not working. I getting error messages. log.xlsx - the log output should... (3 Replies)
Discussion started by: dellanicholson
3 Replies

2. Solaris

Change permissions for files

Hi! I have a dir in a server, that receives files with the wrong permissions, so I decide to put on a cron entry that changes its permitions, but because of the time gap, not all of them get changed. What I did was the following: ... (14 Replies)
Discussion started by: fretagi
14 Replies

3. Shell Programming and Scripting

Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (7 Replies)
Discussion started by: ust3
7 Replies

4. Shell Programming and Scripting

Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (0 Replies)
Discussion started by: ust3
0 Replies

5. Shell Programming and Scripting

sed change in all files

I have a list of property file can each file has name=value kind of key value pair can replace all = with say ; in each file using sed or any other command (4 Replies)
Discussion started by: Vinayshell
4 Replies

6. Shell Programming and Scripting

Find required files by pattern in xml files and the change the pattern on Linux

Hello, I need to find all *.xml files that matched by pattern on Linux. I need to have written the file name on the screen and then change the pattern in the file just was found. For instance. I can start the script with arguments for keyword and for value, i.e script.sh keyword... (1 Reply)
Discussion started by: yart
1 Replies

7. Shell Programming and Scripting

This script cut size of files "Lol" change string in files

Basic: find . -type f -name “*.txt” -print | awk '{gsub("Ontem", "AntesdeOntem", $0); print > FILENAME}' *.txt The idea is in folder /home/myapontamentos I have some files and i need to change in all them the word "ontem" to "antesdeontem". But bigger files are cut (size i mean)... (4 Replies)
Discussion started by: single
4 Replies

8. Shell Programming and Scripting

How to change name for N number of files

Hi Guys, Please can you let me know, how to change file names in a directory that has say 10 files I have files like STR1.rman.pre.script STR1.rman.post.script STR1.rman.inc.script STR1.rman.cold.script STR1.rman.hot.script I need a command to change the above files all in one go... (6 Replies)
Discussion started by: kamathg
6 Replies

9. Shell Programming and Scripting

retain create/mod date and time of files

Hi, I have a requirement by which I need to take a snapshot of a certain directory of a certain types of files into a target directory within the same server (HP-UX 9000). The problem is that the files created in the target directory has the date and time of when the files were copied over. ... (5 Replies)
Discussion started by: jerardfjay
5 Replies
Login or Register to Ask a Question