Sponsored Content
Full Discussion: Findout path
Top Forums Shell Programming and Scripting Findout path Post 302539455 by KenJackson on Sunday 17th of July 2011 05:49:08 PM
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

 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
mkdirp(3G)																mkdirp(3G)

NAME
mkdirp(), rmdirp() - create, remove directories in a path SYNOPSIS
DESCRIPTION
creates all the missing directories in the given path with the given mode (see chmod(2) for the values of mode.) The protection part of the mode argument is modified by the process's file creation mask (see umask(2)). rmdirp removes directories in path d. This removal starts at the end of the path and moves back toward the root as far as possible. If an error occurs, the remaining path is stored in d1. returns a 0 only if it is able to remove every directory in the path. To use these interfaces, link in the libgen library by specifying For example: RETURN VALUE
If a needed directory cannot be created, returns -1 and sets to one of the error numbers. If all the directories are created, or existed to begin with, it returns zero. EXAMPLES
WARNINGS
uses to allocate temporary space for the string. returns if a "" or "" is in the path. It returns if an attempt is made to remove the current directory. If an error occurs other than one of these two errors, returns SEE ALSO
chmod(2), mkdir(2), rmdir(2), umask(2), thread_safety(5). mkdirp(3G)
All times are GMT -4. The time now is 10:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy