I've learned never to parse ls

callerid
Gandalf 2021-04-07 18:31:15 +02:00
parent 19279eefc3
commit 648fa1eb63
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ Put
alias fax="/your/path/to/this/project/fax.sh"
alias faxstatus="/your/path/to/this/project/status.sh"
alias faxbalance="/your/path/to/this/project/balance.sh"
# The following is obsolete, but for documentation/compatibility reasons:
fax-from-handle () { fax $1 "$(/your/path/to/this/project/Letterhead/Adressen/address.sh -f $2)"; }
```
into your `.bashrc` or `.bash_aliases`

2
fax.sh
View File

@ -57,7 +57,7 @@ echo -n "Sending file ${FILE} "
REC=$(echo "$REC0" | sed -e 's:[^+0-9]::g' -e 's:^0\([1-9]\):+49\1:')
echo "to $REC"
#Checking for file size:
SIZE=$(ls -l $FILE | cut -d " " -f5)
SIZE=$(stat -c%s "$FILE")
if [ $SIZE -gt 10485760 ]
then
echo "File too big. Cannot be more than 10MB."