The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 10-03-2006
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,426
You can do something like this :
Code:
echo "Argument count = $#"
if [ $# -gt 0 ]
then
   eval last_arg=\$$#
else
   last_arg='<none>'
fi
echo "Last argument  = $last_arg"

Jean-Pierre.