String Operations On Paths (CMDS: Realpath, Basename and Dirname)
This document discusses three string operations - realpath, basename, and dirname - that can be performed on file paths in Bash shell scripts. realpath converts a relative path to an absolute path without validating it. basename strips directory information and suffixes from filenames. dirname deletes any suffix beginning with the last slash and returns the directory portion of the path.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
15 views3 pages
String Operations On Paths (CMDS: Realpath, Basename and Dirname)
This document discusses three string operations - realpath, basename, and dirname - that can be performed on file paths in Bash shell scripts. realpath converts a relative path to an absolute path without validating it. basename strips directory information and suffixes from filenames. dirname deletes any suffix beginning with the last slash and returns the directory portion of the path.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
String Operations on Paths
(cmds: realpath, basename and dirname)
NarendraP
Learn How to Automate Common Tasks with Bash Shell Scripting
String Operations on Paths realpath : Converts each filename argument to an absolute pathname but it do not validate the path. basename: Strips directory information Strips suffixes from file names dirname : It will delete any suffix beginning with the last slash character and return the result
Learn How to Automate Common Tasks with Bash Shell Scripting