E.g. this code doesnt work:
#!/bin/bash
# Save the current directory
start_dir=$(pwd)
# Find .mwfn files and process each
find . -type f -name "*.mwfn" | sort | while read -r fullpath; do
# Extract directory and filename
dir=$(dirname "$fullpath")
file=$(basename "$fullpath")
echo "Processing $file in $dir"
# Change to the file's directory
cd "$dir" || continue
# Run Multiwfn with input commands
/Users/apm/Applications/Wineskin/Multiwfn.app/Contents/MacOS/wineskinlauncher << EOF
$file
200
3
h
2
3
l
2
0
r
EOF
# Wait 15 seconds before processing the next file
sleep 60
# Return to the original directory
cd "$start_dir" || exit
done
./compound1-S1/compound1-S1.mwfn
./compound1-T1/compound1-T1.mwfn
./compound2-S1/compound2-S1.mwfn
./compound2-T1/compound2-T1.mwfn
./compound2-T2/compound2-T2.mwfn
I need to generate CUBES for occupied and virtual orbitals for each .mwfn file. The commands sequence is:
200
3
h
2
3
l
2
0
Can you share batch code to do that? I dont know programming and doing it manually is cumbersome
Thanks