Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
size1=$(ls -l input.txt | tr -s ' ' | cut -d ' ' -f 5)
size2=$(ls -l /input.txt | tr -s ' ' | cut -d ' ' -f 5)

View file

@ -0,0 +1,10 @@
echo "# ls:"
ls -la input.txt
echo "# stat:"
stat input.txt
echo "# Size:"
size1=$(ls -l input.txt | tr -s ' ' | cut -d ' ' -f 5)
size2=$(wc -c < input.txt | tr -d ' ')
echo $size1, $size2

View file

@ -0,0 +1,2 @@
size1=$(wc -c < input.txt | tr -d ' ')
size2=$(wc -c < /input.txt | tr -d ' ')

View file

@ -0,0 +1,2 @@
size1=$(stat -f %z input.txt)
size2=$(stat -f %z /input.txt)

View file

@ -0,0 +1,5 @@
# from module 'zsh/stat', load builtin 'zstat'
zmodload -F zsh/stat b:zstat
size1=$(zstat +size input.txt)
size2=$(zstat +size /input.txt)

View file

@ -0,0 +1,17 @@
#!/bin/sh
unset PATH # No cheating!
countbytes(){
size=0
# Read the lines in the file
while read -r;do
size=$((size+${#REPLY}+1)) # +1 to account for the newline
done < "$1"
size=$((size+${#REPLY})) # Account for partial lines
echo "$size $1"
}
countbytes input.txt
countbytes /input.txt