Script started on Mon Nov 4 13:02:23 2024 mweeks@air:unix_ch3$ echo 6790 6790 mweeks@air:unix_ch3$ cd ../unix_ch13/ mweeks@air:unix_ch13$ cat process2.c // This function is from Glass and Ables' Unix book // See monitor.c (starting on p 453) #include /* For printf, fprintf */ #include // exit() #include /* For strcmp */ #include /* For isdigit */ #include /* For O_RDONLY */ #include /* For getdents */ #include /* For IS macros */ #include /* For modet */ #include /* For localtime, asctime */ void processDirectory (char* dirName) { /* Process all files in the named directory */ DIR *dp; struct dirent *dep; //char fileName [MAX_FILENAME]; dp = opendir (dirName); /* Open for reading */ if (dp == NULL) { perror("monitor: "); exit(1); } while ((dep = readdir(dp))) /* Read all dir entries */ { if (strcmp (dep->d_name, ".") != 0&& strcmp (dep->d_name, "..") != 0) /* Skip . .. */ { printf ("%s/%s \n", dirName, dep->d_name); // was sprintf //monitorFile (fileName); /* Call recursively */ } } closedir (dp); /* Close directory */ } int main() { return 0; } mweeks@air:unix_ch13$ gcc monitor.c mweeks@air:unix_ch13$ ./a.out Usage: monitor -t -l {filename}+ mweeks@air:unix_ch13$ ./a.out -t5 -l3 Usage: monitor -t -l {filename}+ mweeks@air:unix_ch13$ ./a.out -t5 -l3 monitor.c ADDED monitor.c size 7249 bytes, mod. time = Mon Aug 5 23:48:40 2024 mweeks@air:unix_ch13$ cd ../unix_ch3 mweeks@air:unix_ch3$ cat bool.c cat: bool.c: No such file or directory mweeks@air:unix_ch3$ ls Nov4_2024.log heredoc_test2 args.pl heredoc_test3 bash_scripts_lab loan.pl dummy2 p2.awk ex1.pl p3.awk ex2.pl p4.awk ex3.pl p5.awk ex4.pl run_args.sh ex5.pl run_perl_loan.sh example_shell_script.txt sed1 future sed2 git_diff.txt sed3 mweeks@air:unix_ch3$ cd .. mweeks@air:programs$ find . | grep bool ./more_programs/bool.c ./C_ch2/bool.s ./C_ch2/bool_ex3.c ./C_ch2/bool_ex2.c ./C_ch2/booleans.c ./C_ch2/bool.c ./C_ch2/bool_ex1.c mweeks@air:programs$ diff more_programs/bool.c C_ch2/bool.c 1,5c1 < #include < < int main() { < _Bool found; < found = 0; --- > #include 7c3 < printf("Found is %d\n", found); --- > _Bool flag = 0; 9,10c5,13 < found = 1; < printf("Now, found is %d\n", found); --- > int main() { > > if (flag) > printf("flag is true\n"); > else > printf("flag is false\n"); > > return 0; > } 12,14d14 < return 0; < < } mweeks@air:programs$ mweeks@air:programs$ ls -l more_programs/bool.c -rw-r--r-- 1 mweeks staff 181 Aug 5 23:48 more_programs/bool.c mweeks@air:programs$ mv more_programs/bool.c more_programs/bool_c.080524 mweeks@air:programs$ cp more_programs/bool_c.080524 more_programs/bool.c mweeks@air:programs$ ls -l more_programs/bool* -rw-r--r-- 1 mweeks staff 181 Nov 4 13:28 more_programs/bool.c -rw-r--r-- 1 mweeks staff 181 Aug 5 23:48 more_programs/bool_c.080524 mweeks@air:programs$ more more_programs/bool.c #include int main() { _Bool found; found = 0; printf("Found is %d\n", found); found = 1; printf("Now, found is %d\n", found); return 0; } mweeks@air:programs$ cp C_ch2/bool.c more_programs/bool.c mweeks@air:programs$ more more_programs/bool.c #include _Bool flag = 0; int main() { if (flag) printf("flag is true\n"); else printf("flag is false\n"); return 0; } mweeks@air:programs$ gcc more_programs/bool.c -S mweeks@air:programs$ ls bool* bool.s mweeks@air:programs$ more bool.s .section __TEXT,__text,regular,pure_instructions .macosx_version_min 10, 13 .globl _main ## -- Begin function main .p2align 4, 0x90 _main: ## @main .cfi_startproc ## %bb.0: pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 movq %rsp, %rbp .cfi_def_cfa_register %rbp subq $16, %rsp movl $0, -4(%rbp) testb $1, _flag(%rip) je LBB0_2 ## %bb.1: leaq L_.str(%rip), %rdi movb $0, %al callq _printf movl %eax, -8(%rbp) ## 4-byte Spill jmp LBB0_3 LBB0_2: leaq L_.str.1(%rip), %rdi movb $0, %al callq _printf movl %eax, -12(%rbp) ## 4-byte Spill LBB0_3: xorl %eax, %eax addq $16, %rsp popq %rbp retq .cfi_endproc ## -- End function .globl _flag ## @flag .zerofill __DATA,__common,_flag,1,0 .section __TEXT,__cstring,cstring_literals L_.str: ## @.str .asciz "flag is true\n" L_.str.1: ## @.str.1 .asciz "flag is false\n" .subsections_via_symbols mweeks@air:programs$ cmp more_programs/bool.c more_programs/bool_c.080524 more_programs/bool.c more_programs/bool_c.080524 differ: char 19, line 1 mweeks@air:programs$ tar # tape archive tar: Must specify one of -c, -r, -t, -u, -x mweeks@air:programs$ tar cvf more_programs.tar more_programs/*.c a more_programs/C2F.c a more_programs/C2F2.c a more_programs/array_size.c a more_programs/array_size2.c a more_programs/bool.c a more_programs/commandline.c a more_programs/commandline2.c a more_programs/double_ptr.c a more_programs/enum.c a more_programs/ex_ch12.c a more_programs/fcopy.c a more_programs/fileIOerror.c a more_programs/fopen_example.c a more_programs/guess.c a more_programs/guess2.c a more_programs/guess3.c a more_programs/hello.c a more_programs/hmwk4_good.c a more_programs/hmwk4_student.c a more_programs/hmwk4_student_original.c a more_programs/mydup.c a more_programs/mywait.c a more_programs/null.c a more_programs/pc11_3320.c a more_programs/point1.c a more_programs/point1b.c a more_programs/point1c.c a more_programs/point2.c a more_programs/point2_orig.c a more_programs/point3.c a more_programs/point3b.c a more_programs/point4.c a more_programs/point4a.c a more_programs/point5.c a more_programs/point6.c a more_programs/point7.c a more_programs/point7b.c a more_programs/point8.c a more_programs/popen_example.c a more_programs/prime.c a more_programs/printf_ex.c a more_programs/printf_str1.c a more_programs/printf_str2.c a more_programs/printf_str3.c a more_programs/printf_str4.c a more_programs/printf_str5.c a more_programs/printf_str6a.c a more_programs/printf_str6b.c a more_programs/printf_str6c.c a more_programs/process_dir.c a more_programs/scanf_ex1.c a more_programs/scanf_ex2.c a more_programs/scanf_ex3.c a more_programs/scanf_ex3b.c a more_programs/scanf_ex4.c a more_programs/struct_ex1.c a more_programs/struct_ex2.c a more_programs/struct_ex3.c a more_programs/substr_ex.c a more_programs/testfloat.c a more_programs/testfloat2.c a more_programs/testfloat3.c a more_programs/testfloat4.c a more_programs/three_times_arg_1.c a more_programs/union_ex1.c a more_programs/zombie.c mweeks@air:programs$ sftp mweeks@snowball.cs.gsu.edu mweeks@snowball.cs.gsu.edu's password: Connected to mweeks@snowball.cs.gsu.edu. sftp> ls Sept4_2024.log Sept4_2024.txt bad_example.c donotdothis example1 example2 example3 example_var_types example_var_types.c hello hello.c io_example(1).c io_example.c io_example.s io_example2.c test testfile sftp> put more_programs.tar Uploading more_programs.tar to /home/mweeks/more_programs.tar more_programs.tar 100% 110KB 923.7KB/s 00:00 sftp> quit mweeks@air:programs$ ^ftp^sh^ ssh mweeks@snowball.cs.gsu.edu mweeks@snowball.cs.gsu.edu's password: Last login: Sun Nov 3 10:33:21 2024 from c-24-99-154-26.hsd1.ga.comcast.net + | GSU Computer Science | Instructional Server | SNOWBALL.cs.gsu.edu + [mweeks@gsuad.gsu.edu@snowball ~]$ tar xvf more_programs.tar more_programs/C2F.c more_programs/C2F2.c more_programs/array_size.c more_programs/array_size2.c more_programs/bool.c more_programs/commandline.c more_programs/commandline2.c more_programs/double_ptr.c more_programs/enum.c more_programs/ex_ch12.c more_programs/fcopy.c more_programs/fileIOerror.c more_programs/._fopen_example.c more_programs/fopen_example.c more_programs/guess.c more_programs/guess2.c more_programs/guess3.c more_programs/hello.c more_programs/hmwk4_good.c more_programs/hmwk4_student.c more_programs/hmwk4_student_original.c more_programs/mydup.c more_programs/mywait.c more_programs/null.c more_programs/pc11_3320.c more_programs/point1.c more_programs/point1b.c more_programs/point1c.c more_programs/point2.c more_programs/point2_orig.c more_programs/point3.c more_programs/point3b.c more_programs/point4.c more_programs/point4a.c more_programs/point5.c more_programs/point6.c more_programs/point7.c more_programs/point7b.c more_programs/point8.c more_programs/._popen_example.c more_programs/popen_example.c more_programs/prime.c more_programs/printf_ex.c more_programs/printf_str1.c more_programs/printf_str2.c more_programs/printf_str3.c more_programs/printf_str4.c more_programs/printf_str5.c more_programs/printf_str6a.c more_programs/printf_str6b.c more_programs/printf_str6c.c more_programs/process_dir.c more_programs/scanf_ex1.c more_programs/scanf_ex2.c more_programs/scanf_ex3.c more_programs/scanf_ex3b.c more_programs/scanf_ex4.c more_programs/struct_ex1.c more_programs/struct_ex2.c more_programs/struct_ex3.c more_programs/substr_ex.c more_programs/testfloat.c more_programs/testfloat2.c more_programs/testfloat3.c more_programs/testfloat4.c more_programs/three_times_arg_1.c more_programs/union_ex1.c more_programs/zombie.c [mweeks@gsuad.gsu.edu@snowball ~]$ ls -l total 244 -rwxrwxr-x. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 8360 Sep 9 13:23 bad_example.c -rw-rw-r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 0 Sep 4 13:29 donotdothis -rw-rw-r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 39 Aug 26 13:18 example1 -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 49 Aug 26 13:34 example2 -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 49 Sep 4 13:38 example3 -rwxrwxr-x. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 8368 Sep 16 13:30 example_var_types -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 602 Sep 16 13:29 example_var_types.c -rwxrwxr-x. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 8360 Sep 9 13:22 hello -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 125 Sep 9 13:03 hello.c -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 242 Sep 11 13:22 io_example(1).c -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 385 Sep 11 13:22 io_example2.c -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 242 Sep 11 13:22 io_example.c -rw-rw-r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 736 Sep 11 13:23 io_example.s drwxrwxr-x. 2 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 4096 Nov 4 13:36 more_programs -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 112128 Nov 4 13:36 more_programs.tar -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 40677 Sep 4 17:50 Sept4_2024.log -rw-r--r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 7926 Sep 4 18:33 Sept4_2024.txt drwx------. 2 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 4096 Oct 15 22:11 test -rw-rw-r--. 1 mweeks@gsuad.gsu.edu mweeks@gsuad.gsu.edu 115 Sep 4 13:18 testfile [mweeks@gsuad.gsu.edu@snowball ~]$ rm more_programs.tar [mweeks@gsuad.gsu.edu@snowball ~]$ chmod 700 more_programs/ [mweeks@gsuad.gsu.edu@snowball ~]$ exit logout Connection to snowball.cs.gsu.edu closed. mweeks@air:programs$ cd ~/Desktop/Projects/fox_and_geese/ mweeks@air:fox_and_geese$ ls Game_AI fileIO.h Makefile fileIO.o NN.c fox_and_geese NN.h fox_and_geese.c NN.o fox_and_geese.o NNdataTop50.xml generate_data_easy_fn.csv README.txt log1_NeuroExvolution RNG.c log1_results_unique.csv RNG.h log1_results_unique_sorted.csv RNG.o log1_results_unique_test.csv autorun.sh log1_results_unique_test2.csv bezdekIris_data_normed.csv log1_results_unique_v2.csv bug_w_ints.txt log1_win_loss.csv combine_counts.m mystrings.c convert_experience_data.m mystrings.h converted_data.csv mystrings.o count_same.m oldstuff count_wins_per_NN_set.sh runme.sh data_test_README.txt runme_1000rand_geese.sh delem.xml runme_1000roundrobin_geese.sh example_data_simple_v2.csv runme_backprop.sh example_data_simple_v3.csv training_data_10000_runs.csv experiments.txt training_data_paper.csv fileIO.c training_data_sorted.csv mweeks@air:fox_and_geese$ vi fileIO.c mweeks@air:fox_and_geese$ git status On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: fileIO.c Untracked files: (use "git add ..." to include in what will be committed) delem.xml log1_NeuroExvolution log1_results_unique.csv log1_results_unique_sorted.csv log1_results_unique_test.csv log1_results_unique_test2.csv log1_results_unique_v2.csv log1_win_loss.csv training_data_10000_runs.csv no changes added to commit (use "git add" and/or "git commit -a") mweeks@air:fox_and_geese$ vi fileIO.c mweeks@air:fox_and_geese$ git status On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: fileIO.c Untracked files: (use "git add ..." to include in what will be committed) delem.xml log1_NeuroExvolution log1_results_unique.csv log1_results_unique_sorted.csv log1_results_unique_test.csv log1_results_unique_test2.csv log1_results_unique_v2.csv log1_win_loss.csv training_data_10000_runs.csv no changes added to commit (use "git add" and/or "git commit -a") mweeks@air:fox_and_geese$ git diff HEAD fileIO.c diff --git a/fileIO.c b/fileIO.c index fe0cf68..7d143eb 100644 --- a/fileIO.c +++ b/fileIO.c @@ -1,5 +1,6 @@ #include "fileIO.h" +// Add a new comment here // See find_2strings_in_file.c void showbuffer(char buffer[]) { mweeks@air:fox_and_geese$ exit exit Script done on Mon Nov 4 13:45:27 2024