Search Results

Search: Posts Made By: sasisken
15,795
Posted By fpmurphy
if [ `stat -c %s $a` -gt `stat -c %s $b` ] then...
if [ `stat -c %s $a` -gt `stat -c %s $b` ]
then
echo "$a"
else
echo "$b"
fi


The more modern syntax would be something like this:

if (( $(stat -c %s file1) > $(stat -c %s file2)...
15,795
Posted By bartus11
Two tips: assign stat command output to...
Two tips:


assign stat command output to two variables using syntax: size=`stat ...`
to compare those variables use -gt operator

Also take a look at:...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 05:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy