Findout path


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Findout path
# 1  
Old 07-17-2011
Findout path

hi
Friends,pls help me ,
1.I have one directory,in that directory i have one path like /user/bin/perl
like this.
2.how to find out that path and how to know the that path is existed or not in
that directory.

3.can u people give me one shellscript for this scenario.


Regards
vasu
# 2  
Old 07-17-2011
The question isn't clear.

If you want to find the current directory, the pwd command will give it.

If you want to know if a path exists and is a directory, you can test it something like this (note that you probably mean /usr/, not /user/):
Code:
#!/bin/sh
DIR=/usr/bin/perl
if [ -d "$DIR" ]; then
    echo "Yes, $DIR is a directory"
fi

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies

2. AIX

How to reduce and findout CPU usage?

Frequently i am getting "total CPU is now 100.00%, which is above the error threshold (90%)" this error . (3 Replies)
Discussion started by: ranjithm
3 Replies

3. UNIX for Dummies Questions & Answers

How to findout the files which are created after 12AM in unix server

Hi Friends, I want to get the list of the files which are created after 12AM in the server. Please help me on this to write a script. Thanks Sreenu. (1 Reply)
Discussion started by: sreenu80
1 Replies

4. Linux

Findout iLO type installed in a machine

I have to write Linux script to findout what kind of ilo is been installed in the given ip address either ilo/LO100 or no device found. IP address will be given in the command line of the script. -> With out log on to the ip address, should get the ilo type installed in that machine. 1. I... (1 Reply)
Discussion started by: skmdu
1 Replies

5. UNIX for Advanced & Expert Users

how to findout the file system type?

Hi all, How to findout the file sytem type which is NFS and which is Local? Suppose i have 5 different folders my in Root directory. dir 4 and 5 are mounted on different file system and dir 1,2 and 3 are mounted on different fild system Now i wanted know which file sytem is Local and which... (1 Reply)
Discussion started by: psiva_arul
1 Replies

6. HP-UX

GCC version findout

Hi, In unix box GCC installed under the /usr/local/bin/gcc, i want to know the version of GCC. Could you please let me know the process for that. Thanks & Regards, Suji (1 Reply)
Discussion started by: srujana
1 Replies

7. UNIX for Dummies Questions & Answers

How to findout the creation date?

Hi all Is ther anyway I can findout the date on which a file was created??? Regards Sube (3 Replies)
Discussion started by: sube
3 Replies

8. Solaris

Findout 3rd party softwares in Linux/Solaris server

Hi all, how to find 3rd party softwares like Oracle,phpldapadmin,Citrix etc (other than packages) which are installed on a linux box. Please guide me to get this info'n on LINUX/SOLARIS. Thanks in advance, Uday (0 Replies)
Discussion started by: uday123
0 Replies

9. UNIX for Dummies Questions & Answers

Command to findout the current shell?

Hi, Can you please tell me if there is anyway we can findout which shell we are using (is there any command?) Many thanks, (5 Replies)
Discussion started by: Aceform
5 Replies

10. UNIX for Dummies Questions & Answers

Findout Idle Time Setting

Hi Guru's, How do I find and set the login idle time setting in HP-UX 32? Thanks in advance, Mani (1 Reply)
Discussion started by: jvmani
1 Replies
Login or Register to Ask a Question