C++Guns – RoboBlog blogging the bot


bash / sed - notes

Filed under: — Thomas @ 10:11

Print 3. col

awk '{ print $3 }

Find every file modified at 2.8.2015

find . -type f -newermt 2015-8-02 ! -newermt 2015-08-03

Replace the 4. line in every tfw file inplace with "-0.2"

for i in *.tfw; do sed -i '4 c-0.2' $i; done

For every jpeg2000 image, resize and convert it to an compressed tif image.
Replace file extention ".jp2" with ".tif" and use this as output file.

for i in *jp2; do convert -resize 1000x1000 $i  -compress lzw correctedWorldfile/`basename -z $i .jp2 ;echo ".tif"`; done

Print only every 10. line starting with the first one

sed -n 1~10p in.dat > out.dat

Replace character | with a whirespace

tr '|' ' ' < a.xyz > b.xyz

Compiler Hersteller ermitteln

+ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)

stdout -> Datei umleiten
programm > Datei.txt

stderr -> Datei umleiten
programm 2> Datei.txt

stdout UND stderr -> Datei umleiten
programm &> Datei.txt

stdout -> stderr
programm 1>&2

stderr -> stdout
programm 2>&1

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Powered by WordPress