Sponsored Content
Full Discussion: Read the directory path
Top Forums Shell Programming and Scripting Read the directory path Post 302254727 by sollins on Wednesday 5th of November 2008 03:44:20 AM
Old 11-05-2008
Read the directory path

Hi,

I have a requirement,where i have to read the directory path then read the files present in the directory
Also I need to check the directory path exist in the local drive.
These directory path are mentioned in the Primary.csv file under the column Dir.

Primary.csv
Dir,File1,File2
India/Test/Folder1,Test.csv,Test_cntl,txt
US/Test/Folder2,Test2.csv,Test2_cntl,txt
Australia/Folder3,Sample.csv,Sample_cntl,txt


Thanks for your help!
Soll
 

10 More Discussions You Might Find Interesting

1. Solaris

read a path

Hi I'm trying to write a script in which,if i log onto a particular server,the script should automatically find the server i'm on (which is the source server).We can find it frm the path /transfer/common/utilities/env_params.txt please help me as to how start with this,shall i use the read cmmnd... (2 Replies)
Discussion started by: bkan77
2 Replies

2. Shell Programming and Scripting

read a path

Hi I'm trying to write a script in which,if i log onto a particular server,the script should automatically find the server i'm on (which is the source server).We can find it frm the path /transfer/common/utilities/env_params.txt please help me as to how start with this,shall i use the read cmmnd... (4 Replies)
Discussion started by: bkan77
4 Replies

3. UNIX for Dummies Questions & Answers

How to get directory name from its path?

If I the path to a directory, what command can I use to return the actual name of that directory. test=`pwd`/folder1 > $test folder1 I'd rather avoid anything with regular expressions. Any ideas? (1 Reply)
Discussion started by: ordano
1 Replies

4. Shell Programming and Scripting

how to read the relative path

suppose i ahve a shell script Nsdnet.sh inside a directory /dialp/Release/bin another file nsdnet_file.csv is under the same directory. Now in the shell script i have call a java file, which reads the csvfile from the commandline. Now when i run the file as $ ./Nsdnet.sh ./nsdnet_file.csv then... (5 Replies)
Discussion started by: priyanka3006
5 Replies

5. Shell Programming and Scripting

BASH - read use a path as input

I am trying to script simply data transfer. I would like to have the user input the source "SRC" (/Volumes/DriveName/Users/johnq123) and then name the directory that the copied information will go to, "DST" . put I can't get it to work - #!/bin/bash ... (8 Replies)
Discussion started by: dropkick888
8 Replies

6. Shell Programming and Scripting

Retrieve directory path from full file path through sh

Hi, I have a file abcd.txt which has contents in the form of full path file names i.e. $home> vi abcd.txt /a/b/c/r1.txt /q/w/e/r2.txt /z/x/c/r3.txt Now I want to retrieve only the directory path name for each row i.e /a/b/c/ /q/w/e/ How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies

7. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

8. UNIX for Dummies Questions & Answers

Extract directory name from the full directory path in UNIX using shell scripting

My input is as below : /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt /splunk/scrubbed/triumph/ifind.triumph.txt From the above input I want to extract the file names only . Basically I want to... (5 Replies)
Discussion started by: IshuGupta
5 Replies

9. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

10. UNIX for Beginners Questions & Answers

What is the difference ../directory path and ./directory path in ksh?

What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies
RMDIR(2)						      BSD System Calls Manual							  RMDIR(2)

NAME
rmdir -- remove a directory file LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> int rmdir(const char *path); DESCRIPTION
rmdir() removes a directory file whose name is given by path. The directory must not have any entries other than '.' and '..'. RETURN VALUES
A 0 is returned if the remove succeeds; otherwise a -1 is returned and an error code is stored in the global location errno. ERRORS
The named file is removed unless: [ENOTDIR] A component of the path is not a directory. [ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire path name exceeded {PATH_MAX} characters. [ENOENT] The named directory does not exist. [ELOOP] Too many symbolic links were encountered in translating the pathname. [ENOTEMPTY] The named directory contains files other than '.' and '..' in it. [EACCES] Search permission is denied for a component of the path prefix, or write permission is denied on the directory containing the link to be removed. [EPERM] The directory containing the directory to be removed is marked sticky, and neither the containing directory nor the direc- tory to be removed are owned by the effective user ID. [EBUSY] The directory to be removed is the mount point for a mounted file system. [EIO] An I/O error occurred while deleting the directory entry or deallocating the inode. [EROFS] The directory entry to be removed resides on a read-only file system. [EFAULT] path points outside the process's allocated address space. SEE ALSO
mkdir(2), unlink(2) STANDARDS
The rmdir() function conforms to ISO/IEC 9945-1:1990 (``POSIX.1''). HISTORY
The rmdir() function call appeared in 4.2BSD. BSD
June 4, 1993 BSD
All times are GMT -4. The time now is 09:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy