C Shell path variable causing very slow shell!?HELP


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting C Shell path variable causing very slow shell!?HELP
# 1  
Old 07-07-2011
C Shell path variable causing very slow shell!?HELP

I am using C Shell MKS Toolkit and I ran into a huge problem when setting up some environment variables.Smilie

The csh script that I have as my login script runs fine but very very slow.
When I add a directory to my PATH it seems to slow down shell startup and even slow down the commands.
It is one path directory that is causing me all the problems. The path directory does indeed contain a lot of scipts and files, so I do understand its not going to be as fast, but it slows down the shell way too much. When running the scripts as commands from the directory, it takes around 5-10 seconds when it should be split second commands/scritps. For example, if I put the full path of where the script then its fast. If I rely on the path variables then it takes over 5 seconds! SmilieAnd to start my shell using the script at login takes around 30 seconds!

I hear that path hashing is something that can be the problem fom me since there is one path variable that contains hundreds of files and scripts. I think it would be better without path hashing.
The 'unhash' command does not seem to be doing anything. How can that be??? there is no change in time and hashstat still gives me some numbers at the end. anyone know how I can make sure I turn off path hashing and the use of the internal hashtable??
I don't see how there is no change when using 'unhash'

OK, so perhaps the startup of the shell can be slow, but why is running commands so slow also? I understand the path that contains the command script has a lot of directories, files and scipts but I hear that it should not slow down the shell that significantly.

Anyone run into this problem? or have any suggestions. Anything will be appreciated. Thank you!

Also..how come I always see in examples path variables in the form of something like /somefolder/somefolder but MKS seems to only recognize full paths like drive:/somefolder/somefolder/somefold???

---------- Post updated 07-07-11 at 09:21 AM ---------- Previous update was 07-06-11 at 10:37 AM ----------

Sorry for double posting, but let me ask some simpler questions that will help me..

when I add a PATH variable, sar for example c:/somefolder, do all the directories in c:/somefolder also get referenced?

can anyone explain the 'unhash' command and how they implemented it. I used it in my script but didn't seem to disable the internal hash table lookup.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to use printf to output a shell variable path?

So I created two shell variables: COLUMN1_HEADING, COLUMN2_HEADING. They have values: COLUMN1_HEADING="John" COLUMN2_HEADING="123456789" How would I use printf to get it to print an output like this: $COLUMN1_HEADING\t$COLUMN2_HEADING\nJohn\t123456789\n Thanks! (3 Replies)
Discussion started by: steezuschrist96
3 Replies

2. Shell Programming and Scripting

Shell script reading file slow

I have shell program as below #!/bin/sh echo ======= LogManageri start ========== #This directory is getting the raw data from remote server Raw_data=/opt/ftplogs # This directory is ready for process the data Processing_dir=/opt/processing_dir # This directory is prcoessed files and... (4 Replies)
Discussion started by: Chenchireddy
4 Replies

3. UNIX for Dummies Questions & Answers

Locating shell script files with the $PATH variable

I've created a test script, which is located in $HOME/bin. The script runs as expected with no issues. However, upon echo'ing the $path variable the location of my script is not located in any of the directories listed in $path. So my question is, how does shell know where the script is located... (2 Replies)
Discussion started by: BrandonD
2 Replies

4. Shell Programming and Scripting

Any key press causing logout from shell

Hi all! I have written a shell script which will invoke perl script infinitly in the background in a loop. Code will do as:Within while loop, perl script will be run in background, get the pid and notify pid in though mail. then wait for pid to be completed before going for next iteration. I am... (1 Reply)
Discussion started by: jramesh1
1 Replies

5. Shell Programming and Scripting

Error in setting PATH variable in bash shell

Hi, I am new to shell scripting.I tried adding an entry to the path variable like below export PATH=$PATH:/opt/xxx/bin But am getting an error invalid identifier /opt/xxx/bin Can someone tell me the error above and correct me . Thanks and Regards, Padmini (2 Replies)
Discussion started by: padmisri
2 Replies

6. Shell Programming and Scripting

Reading a path (including ref to shell variable) from file

Hi! 1. I have a parameter file containing path to log files. For this example both paths are the same, one is stated directly and the second using env variables. /oracle/admin/orcl/bdump/:atlas:trc:N ${ORACLE_BASE}/admin/${ORACLE_SID}/bdump/:${ORACLE_SID}:trc:N 2. I try to parse the path... (1 Reply)
Discussion started by: lojzev
1 Replies

7. Shell Programming and Scripting

problem in getting the path of environment variable set in bashrc in my shell script

hi all i have joined new to the group. i have set an variable in my bashrc file. .bashrc PROGHOME=/home/braf/braf/prog export PROGHOME but while using it in my shell script its path is not taken and i had to explicitly give the export command to set the path. in my script... (8 Replies)
Discussion started by: krithika
8 Replies

8. Shell Programming and Scripting

Set Path variable in c shell

I set my path environment variable in c shell, using the syntax below setenv PATH "${PATH}:/usr/local:/usr/local/bin" and placed this in $HOME/.login $HOME/.cshrc and /etc/.login /etc/.cshrc but when I issued echo $PATH or set command the output does not reflect changes made to... (5 Replies)
Discussion started by: hassan2
5 Replies
Login or Register to Ask a Question