#!/bin/bash FILE_LIST=$1 echo "$FILE_LIST" # Check if file_list.txt exists if [ ! -f $FILE_LIST ]; then echo "input file not found!" exit 1 fi INPUT_PATH=/home/richard/Projects/06_research/maximum_planar_subgraph/benchmark_data/graph_datasets/north/gml/ # Read file paths from file_list.txt while IFS= read -r INPUT_FILE; do # Extract filename stem filename=$(basename -- "$INPUT_FILE") filename_stem="${filename%.*}" # Modify output path OUTPUT_PATH=/home/richard/Projects/06_research/maximum_planar_subgraph/benchmark_data/graph_datasets/north/gml_non_planar/ # Run your program and capture its output output=$(./ogdf_test_planar "$INPUT_PATH$INPUT_FILE") # Check the output and perform actions accordingly if [ "$output" -eq 0 ]; then # it is not planar, copy to folder cp "$INPUT_PATH$INPUT_FILE" "$OUTPUT_PATH$INPUT_FILE" fi done < $FILE_LIST