?
Solved

unix very simple

Posted on 2009-12-29
7
Medium Priority
?
388 Views
Last Modified: 2013-12-26
I have a ksh file in a directory mydir/ and the name of file is test.ksh
and I am right now logging in as a different group using
sudo su -appuser
and then when I do pwd , I am in directory called  exp/home/appuser
Now I need to run the script called test.ksh from here How do I do that
0
Comment
Question by:Sara_j_11
7 Comments
 
LVL 85

Accepted Solution

by:
ozo earned 500 total points
ID: 26138072
/mydir/test.ksh
0
 

Author Comment

by:Sara_j_11
ID: 26138099
also what is happening is : when I logon using sudo su -appuser and then go to the directory called
/groupdirectory and then try to run the test1.ksh using ./test1.ksh, what is happening is - the 2 sqls that I have is running fiine- is able to connect to oracle and execute fine. But after that the ksh file has a line where it calls a sas porgram , the code calls it fine(i could see it since I put a set -x before that line.
But when I look in the log file of the sas program , there is an error saying that :::::
USER DOES NOT HAVE APPROPRIATE AUTHORIZATION LEVEL FOR LIBRARY NM.

AND I HAVE DECLARED NM AS /GROUPDIRECTORY

Can you please help me figure out what type of an issue is this. I am 100% positive that there is no issue with the sas program , since I ran that fine by logging in as me(sara) and then going to that directory called /groupdirectory and then I did a ./test1.ksh. and the ksh file that calls the sas script ran without any issues.....
0
 

Author Comment

by:Sara_j_11
ID: 26139785
ok I found out what it could be , I think I need to change the permissions on mydirectory
in the path
teh permissions needs to be drwxrwxr-x  .
Whqat is the chmod command for it. is it chmod go=rwx /mydir

But I want teh files inside the directory /mydir to also have the  same permissions as /mydir
how do i recursively do this?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 500 total points
ID: 26139903
the right command is

chmod -R ug=rwx /mydir

the o here refers to others and not owner, while u refers to owner
0
 
LVL 1

Assisted Solution

by:vancleef
vancleef earned 500 total points
ID: 26140063
You can also use octal permissions... which some people find more obvious.

"chmod 775  /mydir" would change it to rwxrwxr-x  

user,group=7 octal=111, other=5 octal=101, r-x

the "o" and "u" are confusing because they refer to "other" and "user"... The concept of owner didn't evolve until much later.
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 500 total points
ID: 26141071
When you do (fixed the missing space for you)

sudo su - appuser

You are switching to another user (in affect, logging in as that user).  You can change groups within your own user with the 'newgrp' command (Note that you can only change to a group to which you are a member of)

0
 
LVL 1

Expert Comment

by:vancleef
ID: 26142988
One last point about the "-R" option.  I really hate text files that are flagged as executables, so this is how I tend to do it;

% find /mydir -type d -print | xargs chmod 755% find /mydir -type f -print | xargs chmod 644
All directories would be: rwxr-xr-x
All files would be: rw-r--r--

find and xargs are two commands at the top of my use list.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses
Course of the Month16 days, 8 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question