Re: newbie script question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 25, 2004 at 09:29:11AM -0800, Ko Pu wrote:
> I have the following configuration: FC1, Firebird 0.7 & Thunderbird 0.4 in 
> AMD Athlon XP machine. I was trying to create a script, but when I tried to 
> execute it, I got an error. Here's what I have:
> linux (a text file) content:
> cd /mnt/w2k/download/Linux
> 
> I tried to use this command:
> [kpu@d209-121-129-174 kpu]$ . linux
> [kpu@d209-121-129-174 Linux]$ changed to Linux directory
> 
> [kpu@d209-121-129-174 kpu]$ sh linux
> [kpu@d209-121-129-174 kpu]$ nothing happend

It did. But only in the new process. Environment changes don't affect
other processes. In DOS, if a .bat changed the current dir, it also
changed it for the shell. In Linux, each process keeps it's current dir
and can only change its own.

> then I made linux executable and tried to run it by just typing the name:
> [kpu@d209-121-129-174 kpu]$ linux
> bash: linux: command not found

That's because the current path isn't in your PATH environment variable.
Add it like this: PATH=$PATH:., or rather call linux with ./linux. Having
the current directory in PATH is a security problem.

Regards,
Luciano Rocha




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux