{"success":true,"data":{"ext":"sh","name":"SH","description":"SH is a shell script file format used by Unix-like systems, originating with the Bourne shell and maintained through POSIX-compatible shell implementations. It is used to automate command-line tasks, configure environments, start programs, and run installation or administration scripts. Because shell scripts can execute arbitrary commands, files from untrusted sources may alter systems, delete data, or download malware; review scripts before running them.","mime":["application/x-sh"],"risk_level":"High","signatures":[{"hex":"23 21 2F","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"23 21 20 2F","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"23 21 09 2F","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"65 76 61 6C 20 22 65 78 65 63","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]}],"related":["bash","awk","csh","php","pl","pm"],"usage":{"python":"def is_sh(file_path: str) -> bool:\n    \"\"\"Check if file is a valid SH by magic bytes.\"\"\"\n    signature = bytes([0x23, 0x21, 0x2F])\n    with open(file_path, \"rb\") as f:\n        return f.read(3) == signature","node":"function isSH(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x23, 0x21, 0x2F]);\n  return buffer.subarray(0, 3).equals(signature);\n}","go":"func IsSH(data []byte) bool {\n    signature := []byte{0x23, 0x21, 0x2F}\n    if len(data) < 3 {\n        return false\n    }\n    return bytes.Equal(data[:3], signature)\n}"},"category":"Source Code"}}