latest pushes
This commit is contained in:
22
bellos_scripts/basic_math.bellos
Normal file
22
bellos_scripts/basic_math.bellos
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bellos
|
||||
# File: file_operations.bellos
|
||||
|
||||
# Demonstrating file operations
|
||||
|
||||
# Writing to a file
|
||||
echo "This is a test file" > test.txt
|
||||
echo "Adding another line" >> test.txt
|
||||
|
||||
# Reading from a file
|
||||
echo "Contents of test.txt:"
|
||||
cat test.txt
|
||||
|
||||
# Using a while loop to read file line by line
|
||||
echo "Reading file line by line:"
|
||||
while read -r line
|
||||
do
|
||||
echo "Line: $line"
|
||||
done < test.txt
|
||||
|
||||
# Cleaning up
|
||||
rm test.txt
|
Reference in New Issue
Block a user