面试题答案
一键面试#!/bin/bash
file_path=$1
file_size=$(du -b "$file_path" | cut -f1)
if [ $file_size -lt 10000000 ]; then
gzip "$file_path"
else
bzip2 "$file_path"
fi
#!/bin/bash
file_path=$1
file_size=$(du -b "$file_path" | cut -f1)
if [ $file_size -lt 10000000 ]; then
gzip "$file_path"
else
bzip2 "$file_path"
fi