• 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.

Running files in Unix (Solaris and UX)

Arkitech

Diamond Member
When I work in Solaris and I need to run a file or script I typically run the command like this: . ./.programname I never understood the logic behind that, why is it necessary to run programs that way, would'nt it be simpler to use the DOS method by just typing out the filename along with the extension?

Just recently I've started working in a UX (11) environment and I tried to load up a script the same way in Solaris and I get can't find "programname" error. What am I doing wrong?
 
It depends on the directory you are in. In your example ../.programname you are trying to run the program .programname in the directory above (../) your current working directory. If the directory above your directory is in your PATH environment variable ($PATH, echo $PATH to see your current path settings) then typing .programname should be sufficient.

Even in DOS the program has to be in your $PATH (%PATH?) for you to be able to run it without a path (the ../ stuff).

Often times people have to run programs in their current directory preceeded with a ./. . (dot) represents the current working directory, and is often exluded from the $PATH variable for debatable reasons (some people say it helps security). So, in order to run programname in your current directory without . or the full path to the directory (ie. if the program is in /usr/sbin, but /usr/sbin is not in your PATH) you will have to type ./programname. The shell then looks in the current working directory for the program.
 
thanks for the help, that explanation makes sense

I think I managed to run the script I needed in UX but the alias commands that should have been loaded from that script are'nt working. Is there a way to verify that the script I loaded is running?
 
ps auxww | grep programname
or
ps ef | grep programname

depending on the ps command (you probably want the second one).
 
Back
Top