/ Published in: Bash
Simple bash script that sorts a series of numeric parameters using a temporary file and sort command.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/bin/sh # Simple Sort Script By Ben for f in $@ do # Store parameters in temp file echo $f >> sortme.tmp done # Sort temp file for f in `cat sortme.tmp | sort -n` do f2="$f2 $f" done # Delete temp file rm sortme.tmp # Show output echo $f2
URL: http://www.amugofjava.me.uk/