Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash check if file empty

#!/bin/bash -e

if [ -s diff.txt ]; then
        # The file is not-empty.
        rm -f empty.txt
        touch full.txt
else
        # The file is empty.
        rm -f full.txt
        touch empty.txt
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: how to install teamspeak server arch linux 
Shell :: windows terminal starting directory 
Shell :: see map size linux 
Shell :: failed to push some refs to repository 
Shell :: bc sum command 
Shell :: linux remove last n lines from file 
Shell :: install vpn client for ubuntu 20.04 gui 
Shell :: fish add rust to path 
Shell :: git push to branch 
Shell :: run springboot as a service linux 
Shell :: if regex bash 
Shell :: linux view directory premmisiosns 
Shell :: curl request print response 
Shell :: linux restart sendmail 
Shell :: git checkout multiple branches at once 
Shell :: how to install scoop using powershell 
Shell :: list all running processes linux 
Shell :: how to install sublime text in kali linux 
Shell :: ubuntu setting not showing 
Shell :: apt search installed package 
Shell :: how to create a new file in kali linux 
Shell :: env npm 
Shell :: remove trailing slash 
Shell :: src refspec main does not match any 
Shell :: ubunut log as root 
Shell :: whoami linux 
Shell :: select ords version 
Shell :: bash nested for loop one line 
Shell :: install flutter on linux 
Shell :: set permanant environemt variable 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =