play around with bash/unix utilities

This commit is contained in:
NunoSempere 2024-05-10 20:09:35 +01:00
parent e0c570107b
commit a1e724924b
4 changed files with 34 additions and 0 deletions

15
README.md Normal file
View File

@ -0,0 +1,15 @@
To do:
- [ ] Write README
- [ ] Add show more info version
- [ ] Add division?
- [ ] Read from file?
- [ ] Save to file?
- [ ] Program into a small device, like a calculator?
- [ ] Allow comments?
- Use a sed filter?
go run main.go < model.f
sed 's|//||' model.f | go run main.go

9
f.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
#while IFS= read -r line; do echo "$line" | sed 's| //.*||' | go run main.go
# while IFS= read -r line; do echo "$line" | sed 's|//.*||'; done | go run main.go
sed -u 's|//.*||' | go run main.go
# ^ sed unbuffered.
# cat | tee -a log.f | sed -u 's|//.*||' | go run main.go | tee -a log.f

8
log.f Normal file
View File

@ -0,0 +1,8 @@
1 10
=> 1.0 10.0
1 100
=> 2.4 415.0
1 100 //
=> 1.0 100.0
1 10 // hello world
=> 2.4 415.0

2
model.f Normal file
View File

@ -0,0 +1,2 @@
1 10
2 20