How to create a file using shell / bash program script


How to create a file using shell / bash program script

To achieve today in the shell tutorial we are creating a new file by name example2.sh
There might be need to create a file on the fly using the script . 


Create a file example2.sh

paste the below code

#!/bin/sh
touch "testFile"




How to execute shell script


 in command prompt or shell mode

type sh example.sh


now check your folder location the new file will be created


similary log files can be created using shell or bash script


Comments