Use of $ in directory names


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Use of $ in directory names
# 1  
Old 09-06-2001
Use of $ in directory names

I have a TAR (compressed) file that I uncompressed using the following command

$ tar xvf uagent.tar

It created a directory structure as follows

<root>/arcagent/UAGENT/reloc/$UAGENT_HOME/

How do I access files under the $UAGENT_HOME? Every time I do change directory command, the OS thinks $UAGENT_HOME is an alias (which it is not), and I get sent to another directory. If I try to access a file in that directory, I get a message saying the file does not exist, because the OS interprets the $UAGENT_HOME as an alias and looks for the file in another directory.

I need to get to the files under this $UAGENT_HOME directory, but can't.

# 2  
Old 09-06-2001
Did you create the tar file?
If so, why would you name a directory
using a "$"? If not, tell the creator
to fix this. I suspect there is a similar
problem accessing that directory on the remote.

Having said that you should be able to
access it as follows:

cd /arcagent/UAGENT/reloc/\$UAGENT_HOME

...but personally, I hate it when people
name directories like this "on purpose" Smilie
# 3  
Old 09-06-2001
Thanks so much. That worked. The directory was created by a vendor, so I have no control over it. Thanks again.
# 4  
Old 09-06-2001
the "$" and many other charters are called metacharters. they have special meanings to the shell and various programs. in order to use them for there litterl meanings you must escape them. as mentioned above normally the "\" is the escape sequance.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Edit names of files in a directory

Hi all, I have a directory with multiple (thousnads) of files, which are named this way ABCDEF.wo.im-1 OKRAME.ire.roi IOJEAFO01.irt.gfg IMNYBL05.REG.gkf I would like to keep the part of the name (everything before the first dot in the filename). The desired output: ABCDEF... (3 Replies)
Discussion started by: Error404
3 Replies

2. UNIX for Dummies Questions & Answers

Loop through directory names

Some guidance is highly appreciated. I have 10 directories with names ending with 'xyz', each of them have about 30000 files. I want to loop through the contents of each directory and produce a single output per directory. So I want to have 10 output files named 'directory_name'_out. With... (1 Reply)
Discussion started by: newbie83
1 Replies

3. Shell Programming and Scripting

changing multiple directory names

Hi guys, I have lots of files that look like: ABC.packed.dir DEF.packed.dir GHI.packed.dir etc... I would like them to have more of the usual naming convention ABC DEF GHI etc... so I was thinking that I could: (2 Replies)
Discussion started by: atjurhs
2 Replies

4. UNIX for Advanced & Expert Users

Directory with same names and different inode no

I am having a problem where i have two directories with same name and different inode number.I want to get rid of newer one but not sure how should i? Because when i change directory i am not sure where i get in and what i am removing:wall: root@server # ls -lia |grep us000xyz_R5 ... (10 Replies)
Discussion started by: sahil_shine
10 Replies

5. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

6. UNIX for Dummies Questions & Answers

Loop through directory and extract sub directory names

I am trying to loop through folders and extract the name of the lowest level subfolder I was running the script below, it returns /bb/bin/prd/newyork /bb/bin/prd/london /bb/bin/prd/tokyo I really want newyork london tokyo I couldn't find a standard variable for the lowest level... (1 Reply)
Discussion started by: personalt
1 Replies

7. UNIX for Dummies Questions & Answers

How to display only Owner and directory/sub directory names under particular root

hai, I am new to Unix, I have a requirement to display owner name , directory or sub directory name, who's owner name is not equal to "oasitqtc". (here "oasitqtc" is the owner of the directory or sub directory.) i have a command (below) which will display all folders and sub folders, but i... (6 Replies)
Discussion started by: gagan4599
6 Replies

8. Shell Programming and Scripting

Searching for file names in a directory while ignoring certain file names

Sun Solaris Unix Question Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies

9. Shell Programming and Scripting

How to sort directory names and use only last?

I need help writing a bash script for the windows cygwin environment. I'm not sure if bash is the optimal tool. Perhaps perl would be better? Either would work. I have directories whose names include the date they were created. The directory names are in the format of... (0 Replies)
Discussion started by: siegfried
0 Replies

10. Shell Programming and Scripting

directory names in a flat file

Hi, Consider a flat file abc.conf contains some rows. Each row contains the directory name with full path. now I want to find a particular file in every directory which are mentioned in the abc.conf file. How it can be done through unix shell script. (2 Replies)
Discussion started by: surjyap
2 Replies
Login or Register to Ask a Question