Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Define source and target directories
- SRC_DIR="/home/markort/.go/bin"
- DEST_DIR="/home/markort/bin"
- # Ensure the destination directory exists
- mkdir -p "$DEST_DIR"
- # Loop over all files in the source directory
- for file in "$SRC_DIR"/*; do
- # Get the base filename
- filename=$(basename "$file")
- # Define the symlink name with "go_" prefix
- symlink_name="go-$filename"
- # Create the symlink in the destination directory
- ln -sf "$file" "$DEST_DIR/$symlink_name"
- # Print confirmation
- echo "Symlink created: $DEST_DIR/$symlink_name -> $file"
- done
- echo "All symlinks created successfully."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement