Questions tagged [sh]
sh, aka Bourne Shell, is the Unix Shell, the standard shell since v7 Unix. POSIX has standardized the shell, and portable shell scripts should conform to /bin/sh syntax.
                102 questions
            
            
            
                3
            
            votes
        
        
            
                2
            
            answers
        
        
            
                583
            
            views
        
        
            
            
            
        Final look at my Lightshot print screen Linux handler POSIX shell script
                    I would like to ask for a final review of my Lightshot print screen Linux handler POSIX shell script.
When I started writing it, it was a one-liner (shell snippet), but then I decided to grow it, and ...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                115
            
            views
        
        
            
            
            
        Using git autobackup with shell script
                    I have php website for prevent hacker modify any file and inject backdoor.
I want to use git as a file tracking solution.  This is my shell script:
...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                81
            
            views
        
        
            
            
        Check if program has been installed successfully at a given path
                    The path is provided as an argument by a Makefile within an install target. The script verifies if the specified path is already included in the system's ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                166
            
            views
        
        
            
            
            
        Update a docker compose service properly
                    I'm currently running an executable in Docker that has been mounted as a Docker volume in the foreground. The executable (or the service) continuously generates console output and can be interrupted ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                59
            
            views
        
        
            
        Yet another sh script to backup one directory
                    A single directory should simply be backed up with the zip tool, and the time of the backup should be preserved in the file name. I have written a Posix shell script for this.
Can this script simply ...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                142
            
            views
        
        
            
            
        Script to prevent nested root shells (POSIX)
                    Script to prevent nested root shells shall do exactly as said, plus some niceties like an error message when someone runs it with some argument/option.
...
                
            
       
        
            
                4
            
            votes
        
        
            
                1
            
            answer
        
        
            
                81
            
            views
        
        
            
        Debian and Docker compose upgrade script, 2nd version
                    As a continuation of this question, I would like a second review from you.
Here is the updated sh script:
...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                194
            
            views
        
        
            
            
            
        Debian and Docker compose upgrade script
                    I'm running Debian 12 and Docker compose containers. Once a day, crontab should start the script, but the script should also be called manually. Could you rate my upgrade script file or recommend an ...
                
            
       
        
            
                12
            
            votes
        
        
            
                3
            
            answers
        
        
            
                2k
            
            views
        
        
            
            
            
        Blog site generator written in shell script
                    Since I am not a fan of having using large web-frameworks and libraries just to setup a simple blog, I decided to write my own static blog site generator in pure shell script.
The script uses pandoc, ...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                436
            
            views
        
        
            
            
        Shell script to download multiple files from different URL's using for loop to download and verify files on each invocation
                    The expected behavior of the script is to download a file from a URL if the file is not present in the current directory and compare the md5 checksum of the file against the md5 checksum from the ...
                
            
       
        
            
                0
            
            votes
        
        
            
                0
            
            answers
        
        
            
                38
            
            views
        
        
            
            
        For loop to download files once and verify them on each invocation [duplicate]
                    The complete script works as expected. I am able to download and verify the files. If the file is all ready present verification is retested and downloads if necessary.
I'm in the process of teaching ...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                160
            
            views
        
        
            
            
            
        Linux Script Set Permission Function
                    I wrote a simple script to set permissions for a file or folder for some embedded Linux devices as part of a larger setup script.
This method would be called on less than 20 files and folders. It ...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                119
            
            views
        
        
            
            
        Shell script to download, compile and run Analog Clock in AEC
                    As some of you know, I have made a programming language, called AEC, and written two compilers for it, one targetting x86 and other targetting WebAssembly. Recently, I have tried to write two shell ...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                63
            
            views
        
        
            
            
        Find first or last argument lexicographically or temporally
                    I often find I need to find the earliest or latest file matching a given pattern, and sometimes to choose the lowest or highest string from several possibilities.
The following four functions provide ...
                
            
       
        
            
                3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                104
            
            views
        
        
            
            
            
        PDFcomp: A PDF comprimer easy script
                    I developed this script in dead time to be able to compress the PDFs that they send me to university and also to be able to send scans to the various institutions that require formats that do not ...
                
            
       
         
         
         
         
         
         
        