Преглед изворни кода

Simplified manual parsing example.

koalaman пре 9 година
родитељ
комит
b976f5698a
1 измењених фајлова са 3 додато и 9 уклоњено
  1. 3
    9
      README.md

+ 3
- 9
README.md Прегледај датотеку

@@ -39,15 +39,9 @@ https://gist.github.com/naelstrof/6530959
39 39
 For those of you who don't want eval to be an integral part of slop (Could be dangerous if I were evil!): You can change the output format and parse it manually like so:
40 40
 ```bash
41 41
 #!/bin/bash
42
-slopoutput=$(slop -f "%x %y %w %h %g $i")
43
-X=$(echo $slopoutput | awk '{print $1}')
44
-Y=$(echo $slopoutput | awk '{print $2}')
45
-W=$(echo $slopoutput | awk '{print $3}')
46
-H=$(echo $slopoutput | awk '{print $4}')
47
-G=$(echo $slopoutput | awk '{print $5}')
48
-ID=$(echo $slopoutput | awk '{print $6}')
49
-maim -g $G -i $ID
50
-ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+$X,$Y -f alsa -i pulse ~/myfile.webm
42
+read -r X Y W H G ID < <(slop -f "%x %y %w %h %g %i")
43
+maim -g "$G" -i "$ID"
44
+ffmpeg -f x11grab -s "$W"x"$H" -i ":0.0+$X,$Y" -f alsa -i pulse ~/myfile.webm
51 45
 ```
52 46
 
53 47
 ## Lets see some action