|
You are here |
kaveh.page | ||
| | | | |
blog.nuculabs.de
|
|
| | | | | Hello, This challenge is not that hard but it's quite confusing. To solve this challenge very quickly all you have to do is patch it in 2 places and then run it with different arguments until the flags get's spiten out. Here's a sample script that runs the binary 100 times with arguments from 1 to 100 [code language="bash"] printf 'start\n' for i in {1..100} do printf "$i " ./program "$i" | xxd -r -p printf '\n' done printf '\nend\n' [/code] | |
| | | | |
lanziani.com
|
|
| | | | | I do a big use of shell scripts, and many of them contain a for loop, do you know what normally happen when you press CTRL^C and the script is executing an action inside the loop? | |
| | | | |
willhaley.com
|
|
| | | | | This is a trivial example, but is meant to demonstrate how you can pipe arguments to a bash function. #!/usr/bin/env bash lowercase() { # Grab input. declare input=${1:-$(</dev/stdin)}; # Use that input to do anything. echo "$input" | tr '[:upper:]' '[:lower:]' } echo "HELLO there, FRIEND!" | lowercase Which outputs the following. hello there, friend! | |
| | | | |
www.tvagile.com
|
|
| | | |||