fix dd commands

This commit is contained in:
Christoph J. Scherr 2023-09-15 12:59:37 +02:00
parent 367f5a3aab
commit 2f6e8b9ae2
2 changed files with 54 additions and 54 deletions

View File

@ -5,44 +5,44 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
include_directories(${PROJECT_SOURCE_DIR}) include_directories(${PROJECT_SOURCE_DIR})
add_executable( abc src/abc.c ) add_executable( abc src/abc.c )
add_executable( adder src/adder.c ) add_executable( adder src/adder.c )
add_executable( args src/args.c ) add_executable( args src/args.c )
add_executable( arrToBin src/arrToBin.c ) add_executable( arrToBin src/arrToBin.c )
add_executable( ascii src/ascii.c ) add_executable( ascii src/ascii.c )
add_executable( calculator src/calculator.c ) add_executable( calculator src/calculator.c )
add_executable( callreference src/callreference.c ) add_executable( callreference src/callreference.c )
add_executable( circular_shift src/circular_shift.c ) add_executable( circular_shift src/circular_shift.c )
add_executable( complex src/complex.c ) add_executable( complex src/complex.c )
add_executable( dividableBy7 src/dividableBy7.c ) add_executable( dividableBy7 src/dividableBy7.c )
add_executable( structdump src/structdump.c ) add_executable( structdump src/structdump.c )
add_executable( echo src/echo.c ) add_executable( echo src/echo.c )
add_executable( echochar src/echochar.c ) add_executable( echochar src/echochar.c )
add_executable( euler src/euler.c ) add_executable( euler src/euler.c )
add_executable( factorial src/factorial.c ) add_executable( factorial src/factorial.c )
add_executable( fail src/fail.c ) add_executable( fail src/fail.c )
add_executable( fread src/fread.c ) add_executable( fread src/fread.c )
add_executable( hello-world src/hello-world.c ) add_executable( hello-world src/hello-world.c )
add_executable( options src/options.c ) add_executable( options src/options.c )
add_executable( pointermagic src/pointermagic.c ) add_executable( pointermagic src/pointermagic.c )
add_executable( primenumbers src/primenumbers.c ) add_executable( primenumbers src/primenumbers.c )
add_executable( print-syste-constants src/print-system-constants.c) add_executable( print-syste-constants src/print-system-constants.c)
add_executable( quersumme src/quersumme.c ) add_executable( quersumme src/quersumme.c )
add_executable( readfile src/readfile.c ) add_executable( readfile src/readfile.c )
add_executable( redefinition src/redefinition.c ) add_executable( redefinition src/redefinition.c )
add_executable( redefinition-if src/redefinition-if.c ) add_executable( redefinition-if src/redefinition-if.c )
add_executable( return-specified src/return-specified.c ) add_executable( return-specified src/return-specified.c )
add_executable( scanf-test src/scanf-test.c ) add_executable( scanf-test src/scanf-test.c )
add_executable( scnaf-hex-test src/scnaf-hex-test.c ) add_executable( scnaf-hex-test src/scnaf-hex-test.c )
add_executable( signed-to-unsigned src/signed-to-unsigned.c ) add_executable( signed-to-unsigned src/signed-to-unsigned.c )
add_executable( sizeofs src/sizeofs.c ) add_executable( sizeofs src/sizeofs.c )
add_executable( success src/success.c ) add_executable( success src/success.c )
add_executable( sum src/sum.c ) add_executable( sum src/sum.c )
add_executable( tabtest src/tabtest.c ) add_executable( tabtest src/tabtest.c )
add_executable( umlaut src/umlaut.c ) add_executable( umlaut src/umlaut.c )
add_executable( unary-double-not src/unary-double-not.c ) add_executable( unary-double-not src/unary-double-not.c )
add_executable( warning src/warning.c ) add_executable( warning src/warning.c )
add_executable( pointer-arithmetic src/pointer-arithmetic.c ) add_executable( pointer-arithmetic src/pointer-arithmetic.c )
target_link_libraries(abc m) # link libm to abc target_link_libraries(abc m) # link libm to abc
@ -50,24 +50,24 @@ project(huffman)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_executable( huffman src/huffman/src/huffman.c ) add_executable( huffman src/huffman/src/huffman.c )
execute_process ( execute_process (
COMMAND bash -c "mkdir -p src/huffman/testfiles" COMMAND bash -c "mkdir -p src/huffman/testfiles"
COMMAND bash -c "yes 'SAFJALJ AF OIAIFOsdp' | head -c 100KB > src/huffman/testfiles/small.txt" COMMAND bash -c "yes 'SAFJALJ AF OIAIFOsdp' | head -c 100KB > src/huffman/testfiles/small.txt"
COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/1K-random.img count=1KiB" COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/1K-random.img count=1 bs=1KiB"
COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/10K-random.img count=10KiB" COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/10K-random.img count=1 bs=10KiB"
COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/100K-random.img count=100KiB" COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/100K-random.img count=1 bs=100KiB"
COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/1M-random.img count=1MiB" COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/1M-random.img count=1 bs=1MiB"
COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/10M-random.img count=10MiB" COMMAND bash -c "dd if=/dev/urandom of=src/huffman/testfiles/10M-random.img count=1 bs=10MiB"
COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/1K-zero.img count=1KiB" COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/1K-zero.img count=1 bs=1KiB"
COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/10K-zero.img count=10KiB" COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/10K-zero.img count=1 bs=10KiB"
COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/100K-zero.img count=100KiB" COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/100K-zero.img count=1 bs=100KiB"
COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/1M-zero.img count=1MiB" COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/1M-zero.img count=1 bs=1MiB"
COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/10M-zero.img count=10MiB" COMMAND bash -c "dd if=/dev/zero of=src/huffman/testfiles/10M-zero.img count=1 bs=10MiB"
COMMAND bash -c "echo -e \"Wer\ndas\nliest\nist\ndoof\n\" > src/huffman/testfiles/tiny.txt" COMMAND bash -c "echo -e \"Wer\ndas\nliest\nist\ndoof\n\" > src/huffman/testfiles/tiny.txt"
COMMAND bash -c "yes 'lslfkpoipop iipfiasp' | head -c 1MB > src/huffman/testfiles/mid.txt" COMMAND bash -c "yes 'lslfkpoipop iipfiasp' | head -c 1MB > src/huffman/testfiles/mid.txt"
) )
# TODO add condition to also generate bigger files # TODO add condition to also generate bigger files
# TODO add targets for these testfiles # TODO add targets for these testfiles

View File

@ -1,4 +1,4 @@
# Install script for directory: /home/plex/Documents/code/c/c-basic # Install script for directory: /home/cscherr/Documents/code/c/c-basic
# Set the install prefix # Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX) if(NOT DEFINED CMAKE_INSTALL_PREFIX)
@ -29,7 +29,7 @@ endif()
# Install shared libraries without execute permission? # Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "0") set(CMAKE_INSTALL_SO_NO_EXE "1")
endif() endif()
# Is this installation the result of a crosscompile? # Is this installation the result of a crosscompile?
@ -50,5 +50,5 @@ endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}") "${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/home/plex/Documents/code/c/c-basic/${CMAKE_INSTALL_MANIFEST}" file(WRITE "/home/cscherr/Documents/code/c/c-basic/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}") "${CMAKE_INSTALL_MANIFEST_CONTENT}")