Skip to main content
added 119 characters in body
Source Link

Just to not miss perl:

perl -e '@a=split /\\/, $ARGV[0]; print(join("\\", splice @a, 3), "\n")' $str

Where str is the path.

Or without the endings new line :

perl -e '@a=split /\\/, $ARGV[0]; print join "\\", splice @a, 3' $str

Just to not miss perl:

perl -e '@a=split /\\/, $ARGV[0]; print(join("\\", splice @a, 3), "\n")' $str

Where str is the path.

Just to not miss perl:

perl -e '@a=split /\\/, $ARGV[0]; print(join("\\", splice @a, 3), "\n")' $str

Where str is the path.

Or without the endings new line :

perl -e '@a=split /\\/, $ARGV[0]; print join "\\", splice @a, 3' $str
Source Link

Just to not miss perl:

perl -e '@a=split /\\/, $ARGV[0]; print(join("\\", splice @a, 3), "\n")' $str

Where str is the path.