bash_quote: correct shebang and check if lynx is available.
This commit is contained in:
		
							parent
							
								
									eaa960ae4e
								
							
						
					
					
						commit
						18224ba566
					
				|  | @ -1,8 +1,12 @@ | ||||||
| #! /bin/sh | #! /usr/bin/env sh | ||||||
| 
 | 
 | ||||||
| # Description:            Get a quot from http://danstonchat.com | # Description:            Get a quot from http://danstonchat.com | ||||||
| 
 | 
 | ||||||
| lynx --dump --display_charset=utf8 http://danstonchat.com/random.html | awk '$4~"commentaires" && $0!~"RSS" { getline; while ($4!~"#") { print $0; getline;}; exit}' | if [ $(command -v lynx) ]; then | ||||||
|  |   lynx --dump --display_charset=utf8 http://danstonchat.com/random.html | awk '$4~"commentaires" && $0!~"RSS" { getline; while ($4!~"#") { print $0; getline;}; exit}' | ||||||
|  | else | ||||||
|  |   printf '%b' "Please install lynx package.\n" | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| #awk                     : chope les lignes où… | #awk                     : chope les lignes où… | ||||||
| #$1~"#"                  : le premier terme ($1) contient un dièse | #$1~"#"                  : le premier terme ($1) contient un dièse | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue