Commit 739a838e authored by Mateusz Pawlik's avatar Mateusz Pawlik

Fixed counting the right brackets for sorting.

parent 69b520c1
#!/bin/bash #!/bin/bash
# | sort by number of nodes (equivalent to number of "{"), remove duplicates # | sort by number of nodes (equivalent to number of "{"), remove duplicates
cat $1 | perl -F{ -lane 'print "$#F $_"' | sort -n | cut -d' ' -f2- > "${1%.bracket}_sorted.bracket" # cat $1 | perl -F{ -lane 'print "$#F $_"' | sort -n | cut -d' ' -f2- > "${1%.bracket}_sorted.bracket"
cat $1 | awk '{print gsub("{","{")-gsub("\\\\{","\\{"), $0}' | sort -n | cut -d' ' -f2- > "${1%.bracket}_sorted.bracket"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment