1 #!/bin/sh 2 3 for i in `ls` 4 do 5 if [[ "$i" == *.txt ]] 6 then 7 echo "$i is .txt file" 8 else 9 echo "$i is NOT .txt file" 10 fi 11 done
The Bash sequence expression generates a range of integers or characters by defining a start and the end point of the range. It is generally used in combination with for loops.
Linux Tutorial - Shell Bash Commands from the Beginning with Examples. Learn BASH command interpreter explained step by step and with examples. Learn what Linux is and how the command interpreter fits into the operating system. Get and install Linux. Understand the structure and syntax of Linux commands. Learn to manage the elements of the filesystem: files and directories. Learn to install software from official servers or from any compatible file.
I am trying to write a bash alias to wrap around a Git commit command.
I am trying to create a bash script to create a boilerplate django project that suits for my company. I need to delete the DATABASES in settings and append new one. The DATABASES is a python dictionary with structure
I'm creating a script to rotate my backups, one important part of this script is to find the files based on certain criteria and then move them or erase them.