29.06.2013 Views

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Related Information<br />

Examples<br />

v ln - Link files<br />

v ls - List directory contents<br />

v mv - Move files<br />

v rm - Remove directory entries<br />

v rmdir - Remove directories<br />

v umask - Get or set the file mode creation mask<br />

1. Copy the file, “file1”, into the subdirectory, “data.dir”.<br />

cp file1 data.dir<br />

2. Copy all the files with the .java extension from the “code” subdirectory into the<br />

subdirectory, “code/old_code.dir” and prompt the user for overwrite verification<br />

only if the file already exists in the subdirectory, “code/old_code.dir”.<br />

cp -i code/*.java code/old_code.dir<br />

[ Legal | AS/400 Glossary ]<br />

dirname - Return directory portion of pathname<br />

Synopsis<br />

Description<br />

Operands<br />

Exit Status<br />

52 <strong>Qshell</strong> <strong>Interpreter</strong> (<strong>qsh</strong>)<br />

dirname string<br />

You can use dirname to delete the filename portion, beginning with the last slash<br />

character (/) to the end of string, and write the result to standard output. The string<br />

is processed using the following rules:<br />

v If string consists entirely of slash characters, a single slash character is written to<br />

standard output and processing ends.<br />

v If there are any trailing slash characters in string, they are removed.<br />

v If there are no slash characters remaining in string, a period character is written<br />

to standard output and processing ends.<br />

v If there are trailing non-slash characters in string, they are removed.<br />

v If there are any trailing slash characters in string, they are removed.<br />

v If the remaining string is empty, string is set to a single slash character.<br />

The string operand is the pathname of which dirname will return the directory<br />

portion of.<br />

v 0 on success<br />

v >0 if an error occurs.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!