#!/bin/sh if [ "$#" -ne 1 ]; then echo "Usage: $0 " exit 1 fi CHROOT_PATH="$1" if [ ! -d "$CHROOT_PATH" ]; then echo "Error: Destination path '$CHROOT_PATH' does not exist." exit 1 fi # Get the @INC paths from Perl INC_PATHS=$(perl -e 'print join("\n", @INC)') # Loop through each path and copy it to the destination for isrc in $INC_PATHS; do idst=$(dirname "$CHROOT_PATH$isrc") mkdir -p "$idst" cp -R "$isrc" "$idst" done echo "Copy completed."