Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Friday, November 14, 2014

Command line Rosetta stone

C

argc is the number of elements in argv[], which is 0-based.

Executable name is argv[0] and arguments are argv[1..]

Perl

$#ARGV is the index of the last element in @ARGV, which is 0-based.

Executable name is $0 and arguments are $ARGV[0..]

Autoit3

$CmdLine[0] is the index of the last element in $CmdLine, which is 1-based.

Executable name is @AutoItExe and arguments are $CmdLine[1..]

Command line as entered is $CmdLineRaw.

C#

args.Length is the number of elements in args, which is 0-based.

There's no simple answer to finding the executable name. Arguments are args[0..] or Environment.GetCommandLineArgs(). My tests show [0] as the first argument, the documentation says [0] is the executable name.

Command line as entered is Environment.CommandLine.

Followers

Blog Archive