add fixincludes

This commit is contained in:
mrbesen 2020-04-29 12:59:38 +02:00
parent f306396c1a
commit 044703c319
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
2 changed files with 20 additions and 1 deletions

2
README.md Normal file → Executable file
View File

@ -6,6 +6,7 @@ A Collection of some "useful" scripts
|------|---------|------------|
|```downloadhelper.sh``` | download anc convert Youtube Videos or Soundcloud Songs | Youtube-DL & ffmpeg
|```fixcam.sh``` |remove " (1)" from all files inside a folder| |
|```fixincludes.sh```| fixes wrong includes. Takes a Folder of c/c++ Code and corrects the includes, that are not case sensitive (local includes only) | sed, awk, bash |
|```kvm.sh``` |start a kvm| kvm |
|```load.sh``` |download a bunch of sequentialy numbered files| wget |
|```m3u8append.sh``` | takes a m3u8 playlist, removes comments (lines starting with '#') and addes a line in front of every other line. Saves the output to a difrent file. | |
@ -16,4 +17,3 @@ A Collection of some "useful" scripts
|```timelapse.sh```| a script to create timelapses with a webcam | imagemagick, ffmpeg & streamer |
|```setup.sh```| a script that installs all my useful tools, after i reinstalled my Operating System - BE CAREFUL! | fstab |

19
fixincludes.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
#small script, that fixes wrong includes (case insensitive to case sensitive) from windows sourcecode
#requires: sed, awk, bash
sedfile="includes.sed"
srcf="src/"
echo "generate sedfile"
ls ${srcf}*.h | cut -d "/" -f 2 | awk '{print "s/#include \"" $0 "\"/#include \"" $0 "\"/Ig"}' > "$sedfile"
#anwenden
for f in ${srcf}*; do
echo "fix includes for: $f"
sed -Ef $sedfile "$f" > "$f.fixed"
mv "$f.fixed" "$f"
done
echo "delete sedfile"
rm $sedfile