ferret 1266793486 learn The last argument of the previous command is available in the "$_" variable. Try these: days_this_month() { : cal; echo $_; }; last_file_alphabetically() { : ./*; echo "$_"; } ferret 1266793508 forget ferret 1266793517 learn The last argument of the previous command is available in the "$_" variable. Try these: days_this_month() { : $(cal); echo $_; }; last_file_alphabetically() { : ./*; echo "$_"; } ormaaj 1333507078 forget ormaaj 1333507092 learn Dereference last element of an array - Bash 4.2 or later: "${array[-1]}", <= 4.1.x: "${array[@]:(-1)}". You cannot assign to negative indexes in Bash, even if array already exists. izabera 1429438360 forget izabera 1429438365 learn Dereference last element of an array - Bash 4.2 or later: "${array[-1]}", <= 4.1.x: "${array[@]:(-1)}". Since 4.3 you can assign to negative values, if the element already exists.