In the Bash script,
write a simple program that first creates a new file called myfile.txt, then append the string "Hello world" to it. Then print out the size in bytes of myfile.txt.
>Solution :
In bash the solution would be:
#!/bin/bash
# Create new file called myfile.txt
touch myfile.txt
# Append the string "Hello world" to the file
echo "Hello world" >> myfile.txt
# Print the size in bytes of myfile.txt
filesize=$(wc -c < myfile.txt)
echo "File size: $filesize bytes"
I don’t know what this has to do with node.js or java – please provide further information