{"id":26869986,"url":"https://github.com/carterlasalle/script-and-tools","last_synced_at":"2026-04-28T17:33:30.642Z","repository":{"id":164168029,"uuid":"639619105","full_name":"carterlasalle/script-and-tools","owner":"carterlasalle","description":"This repository is a collection of various scripts written in Python, Shell (.sh), and other languages. The scripts perform a variety of tasks and you can use them as per your requirements.","archived":false,"fork":false,"pushed_at":"2023-05-11T21:27:52.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-01T18:18:08.452Z","etag":null,"topics":["python","python3","random","script","scripts","tools"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carterlasalle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-11T21:04:06.000Z","updated_at":"2023-05-11T21:28:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c1b9957-0226-41a7-8e6d-c6459369e9e0","html_url":"https://github.com/carterlasalle/script-and-tools","commit_stats":null,"previous_names":["carterlasalle/script-and-tools"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/carterlasalle/script-and-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carterlasalle%2Fscript-and-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carterlasalle%2Fscript-and-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carterlasalle%2Fscript-and-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carterlasalle%2Fscript-and-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carterlasalle","download_url":"https://codeload.github.com/carterlasalle/script-and-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carterlasalle%2Fscript-and-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32392296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","python3","random","script","scripts","tools"],"created_at":"2025-03-31T06:19:33.815Z","updated_at":"2026-04-28T17:33:30.622Z","avatar_url":"https://github.com/carterlasalle.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# script-and-tools\n\nThis repository is a collection of various scripts written in Python, Shell (.sh), and other languages. The scripts perform a variety of tasks and you can use them as per your requirements. \n\nPlease note that these scripts don't accept arguments such as `-d`. You need to manually input the directory in the scripts. The suffixes in the scripts can be changed according to your needs.\n\n## Current Scripts\n\nCurrently, the repository contains the following scripts:\n\n1. **removesuffixoffile.sh:** This script removes specified suffixes from the file names in the provided directories. The script currently removes suffixes such as `_door`, `_stairs`, and `_above`.\n\n2. **separatefilesintofoldersbysuffix.sh:** This script separates files into different folders based on their suffixes. It creates directories named `above`, `stairs`, and `door` and moves files with corresponding suffixes into these directories.\n\n### removesuffixoffile.sh\n\n```bash\n#!/bin/bash\n\n# The directories to be processed. Put your directories here:\ndirectories=(\"\")\n\n# Process each directory\nfor directory in \"${directories[@]}\"; do\n    # Process each file in the directory\n    for file in \"$directory\"/*; do\n        echo \"Processing file: $file\"\n        # Get the base filename without the extension\n        base_name=$(basename \"$file\" .png)\n        # Remove the suffix from the base filename\n        new_base_name=$(echo \"$base_name\" | sed -e 's/_door//' -e 's/_stairs//' -e 's/_above//')\n        # Construct the new filename with the directory and extension\n        new_name=\"$directory/$new_base_name.png\"\n        # Only rename the file if the new name is different\n        if [[ \"$file\" != \"$new_name\" ]]; then\n            echo \"Renaming $file to $new_name\"\n            mv \"$file\" \"$new_name\"\n        fi\n    done\ndone\n```\n### separatefilesintofoldersbysuffix.sh\n\n```bash\n#!/bin/bash\n\n# The directory to be processed. Put your directory here:\ndirectory=\"\"\n\n# Directories where files will be moved\nabove_dir=\"${directory}/above\"\nstairs_dir=\"${directory}/stairs\"\ndoor_dir=\"${directory}/door\"\n\n# Create the directories if they don't exist\nmkdir -p \"$above_dir\"\nmkdir -p \"$stairs_dir\"\nmkdir -p \"$door_dir\"\n\n# Process each file in the directory\nfor file in \"$directory\"/*; do\n    echo \"Processing file: $file\"\n    if [[ $file == *_above* ]]; then\n        echo \"Moving $file to $above_dir\"\n        mv \"$file\" \"$above_dir\"\n    elif [[ $file == *_stairs* ]]; then\n        echo \"Moving $file to $stairs_dir\"\n        mv \"$file\" \"$stairs_dir\"\n    elif [[ $file == *_door* ]]; then\n        echo \"Moving $file to $door_dir\"\n        mv \"$file\" \"$door_dir\"\n    fi\ndone\n```\n\n## Usage\n\nTo use the scripts, you need to update the directories in the scripts to match your requirements.\n\n### removesuffixoffile.sh\n\nIn the `removesuffixoffile.sh` script, update the `directories` variable with the directories you want to process. For example:\n\n```bash\ndirectories=(\"/path/to/directory1\" \"/path/to/directory2\")\nseparatefilesintofoldersbysuffix.sh\n```\n\nIn the separatefilesintofoldersbysuffix.sh script, update the directory variable with the directory you want to process. For example:\n\n```bash\n\ndirectory=\"/path/to/directory\"\n```\n\n### Running the Scripts\n\nAfter you have updated the scripts with your directories, you can run them from a terminal as follows:\n\n```bash\n\nbash removesuffixoffile.sh\n```\n```bash\n\nbash separatefilesintofoldersbysuffix.sh\n```\n### Changing Suffixes\n\nThe scripts are currently set up to work with file suffixes _above, _stairs, and _door. If you want to use different suffixes, you can change them in the scripts.\n\nIn the removesuffixoffile.sh script, you can change the suffixes in the sed command:\n\n```bash\n\nnew_base_name=$(echo \"$base_name\" | sed -e 's/_your_suffix//' -e 's/_your_suffix//' -e 's/_your_suffix//')\n```\nIn the separatefilesintofoldersbysuffix.sh script, you can change the suffixes in the if statements:\n\n```bash\n\nif [[ $file == *_your_suffix* ]]; then\n    echo \"Moving $file to $your_dir\"\n    mv \"$file\" \"$your_dir\"\n```\n## Contributing\n\nContributions to this repository are welcome. Feel free to submit a pull request with your script.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarterlasalle%2Fscript-and-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarterlasalle%2Fscript-and-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarterlasalle%2Fscript-and-tools/lists"}