This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cmd line arg help in stp


Hi,

Iam looking at a way to iterate the multiple command line arguments i passed with my script.

#stap xyz.stp <arg 1> <arg2> <arg3>

arc are strings. '$#' gives me the max number of arguments passed and '$1' , '$2' .... gives each of the args. But the number of args iam passing to the script is not fixed.

Can somone help me with writing a sample code in system tap that can do this? I need something similar to what the below script does

while [ $# -gt 0 ]
do

  echo $1
  shift

done

or in c we have argc and argv []. Any suggestions? Iam new to stap scripting so please suggest a method to do this or point me to some code that already does something similar. Thanks.

Regards,
Varun


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]