Writing shell scripts

Writing shell scripts

Shell scripts are very useful, in increasing productivity in various tasks. In particular they are great for tasks that involve working with multiple files and directories and using them in conjunction with CLIs (Command Line Interfaces). This posts provides some useful things to know when writing shell scripts.

Example bash script

    

#!/bin/bash

for file in imported_from_console/c752lfy3wvh73hfjlnplpqyapi/*.*;
    do 
        # echo "$file"
        VAR=$(basename "$file");
        echo $VAR;
        code -r --diff ./imported_from_console/c752lfy3wvh73hfjlnplpqyapi/$VAR ./imported_from_console/mkmffnhyp5d7blhj3mu7kz4zr4/$VAR;
done
    

References

Tags: