How to pass argument to Makefile from command line?

You probably shouldn’t do this; you’re breaking the basic pattern of how Make works. But here it is: action: @echo action $(filter-out $@,$(MAKECMDGOALS)) %: # thanks to chakrit @: # thanks to William Pursell EDIT: To explain the first command, $(MAKECMDGOALS) is the list of “targets” spelled out on the command line, e.g. “action value1 … Read more

Command prompt won’t change directory to another drive

As @nasreddine answered or you can use /d cd /d d:\Docs\Java For more help on the cd command use: C:\Documents and Settings\kenny>help cd Displays the name of or changes the current directory. CHDIR [/D] [drive:][path] CHDIR [..] CD [/D] [drive:][path] CD [..] .. Specifies that you want to change to the parent directory. Type CD … Read more

How to animate the command line?

One way to do this is to repeatedly update the line of text with the current progress. For example: def status(percent): sys.stdout.write(“%3d%%\r” % percent) sys.stdout.flush() Note that I used sys.stdout.write instead of print (this is Python) because print automatically prints “\r\n” (carriage-return new-line) at the end of each line. I just want the carriage-return which … Read more

How to use command line arguments in Fortran?

If you want to get the arguments fed to your program on the command line, use the (since Fortran 2003) standard intrinsic subroutine GET_COMMAND_ARGUMENT. Something like this might work PROGRAM MAIN REAL(8) :: A,B integer :: num_args, ix character(len=12), dimension(:), allocatable :: args num_args = command_argument_count() allocate(args(num_args)) ! I’ve omitted checking the return status of … Read more