• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

any unix ppl still up??

vrbaba

Diamond Member
I am trying to run a .sh script. i go in that directory, and type its name. I keep getting a message: Permission denied.
what else do i need to type to run it? besides the full name.

EDIT: what does this mean:

2) Add [ns-dir]/nam-1.11, [ns-dir]/ns-2.29, and [ns-dir]/bin to the PATH environment variable in your ~/.cshrc file, and run "source ~/.cshrc". For example, if your ns is installed at ~/ns2-ubuntu, update .cshrc to "set path=($path ~/ns2-ubuntu/bin ~/ns2-ubuntu/nam-1.11 ~/ns2-ubuntu/ns-2.29), and then run "source ~/.cshrc".

where do I open the .cshrc file from? and where exactly do i put that line in?
 
do you own the file?

do a "ls -al" and see the permissions for that file. If you don't own it, then you will have to log in as an administrator and do a "chown" to the user that is trying to run it.
 
Let's see...
My guess is that you need permission to that directory or file.. duha.
You do know how to set permisions in unix right?
 
its my school's unix system that i am accessing. new to the school, so first time setting all this stuff up.

anyways... I think i need to set file permissions to executable first any ideas?
 
Originally posted by: fornax
% chmod +x <your sh script name>
% ./<your sh script name>

nevermind, that worked, I THINK. there were some error messages from the script itself though.
but a directory structure with some files were created as the script was suppose to do.

thanks
 
Do you have to run csh?
The .cshrc in your home directory. This is usually the directory you end up in when you ssh or telnet into a unix box.
the ~ in ~/.cshrc means 'your home directory'. If your home directory is /home/vrbaba then the .cshrc would be in /home/vrbaba/.cshrc.

The file is hidden so you will have to do a 'ls -al' to list it. You can also open the file in vi by using 'vi /home/vrbaba/.cshrc'
 
If your default shell is sh, you can jump into c shell by typing "tcsh". This should automatically create the .cshrc file for you. Otherwise, just vi .cshrc.
 
This is what is in my .cshrc file:

# Determine if this is an interactive shell, e.g., the login shell
# or a shell forked by an editor.
if ($?prompt) then
# yes, login shell

# remember the last 20 commands executed and save them across logins
set history = 20 savehist = 20

# set up a shorter name for the history command
alias h history

# and a shorter name for the jobs command
alias j jobs

else

# give me the default path when I "rsh"
if (-f /lusr/lib/misc/path.csh) then
source /lusr/lib/misc/path.csh
endif

endif

#

how do I append the path thats mentioned in OP?
 
If you read your post, it tells you how to set it.

At the end of the .cshrc put the following..


...
...
else

# give me the default path when I "rsh"
if (-f /lusr/lib/misc/path.csh) then
source /lusr/lib/misc/path.csh
endif

endif

#

set path=($path ~/ns2-ubuntu/bin ~/ns2-ubuntu/nam-1.11 ~/ns2-ubuntu/ns-2.29)




save the .cshrc file in vi.
At the prompt type in 'source ./.cshrc'


 

In the last line of the file, add the following line:



export PATH=$PATH:~/ns2-ubuntu/bin:~/ns2-ubuntu/nam-1.11:~/ns2-ubuntu/ns.229



Of course, this is presumeing that whatever you are trying to install is located in the ~/ns2-ubuntu directory....


 
Back
Top