LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is this strange directory (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-this-strange-directory-501896/)

tekmann33 11-15-2006 12:39 PM

What is this strange directory
 
I am a systems tech somewhat familiar with Linux, however I have come across a odd directory that behaves quite strangely.

This is a Solaris system and there is a directory with this format:

&SAVEDLISTS&

When I try to change to the directory as a root user, I get this:

cd &SAVEDLISTS&
[1] 1089570
[2] 868412
[1] - Done cd &SAVEDLISTS&
# ksh: SAVEDLISTS: not found.

What kind of directory has these ampersands before and after and what is this output I am getting?

fordeck 11-15-2006 01:09 PM

Universe database's typically have a file not a directory by the name &SAVEDLISTS&.

PTrenholme 11-15-2006 01:56 PM

And, of course, you have to "escape" the ampersands to get the shell use them as text instead of a "spawn" directive.

matthewg42 11-15-2006 01:57 PM

Looks like this was created either by mistake by a user or by a program with a bug in it (I'd guess some SQL script which uses variable expansion with the '&variablename' syntax that SQL*PLUS uses, but the expansion didn't happen for some reason).

Anyhow, to the shell, the & character is a special one which tells the shell to put the command which comes before it into the background (using shell job control).

You can tell the shell not to interpret the & character in this way by quoting your argument to cd (or whatever command you are trying to execute):
Code:

cd '&SAVEDLISTS&'


All times are GMT -5. The time now is 12:13 AM.