silly script for testing
This commit is contained in:
		
							parent
							
								
									fb3eac1901
								
							
						
					
					
						commit
						29ae482d46
					
				
							
								
								
									
										25
									
								
								create-dummy-files.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										25
									
								
								create-dummy-files.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Configuration variables
 | 
				
			||||||
 | 
					TARGET_DIR="."          # Directory where files will be created
 | 
				
			||||||
 | 
					FILE_EXTENSIONS=("JPG" "MP4" "DNG") # Array of file extensions
 | 
				
			||||||
 | 
					NUM_FILES=25                        # Number of files to create for each extension
 | 
				
			||||||
 | 
					FILE_SIZE=10000                       # Size of each file in bytes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Function to create a single dummy file
 | 
				
			||||||
 | 
					create_dummy_file() {
 | 
				
			||||||
 | 
					    local file_path="$1"
 | 
				
			||||||
 | 
					    head -c "$FILE_SIZE" </dev/urandom > "$file_path"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Iterate over each file extension and create the dummy files
 | 
				
			||||||
 | 
					for ext in "${FILE_EXTENSIONS[@]}"; do
 | 
				
			||||||
 | 
					    for ((i=1; i<=NUM_FILES; i++)); do
 | 
				
			||||||
 | 
					        file_name="dummy_file_${i}.${ext}"
 | 
				
			||||||
 | 
					        file_path="$TARGET_DIR/$file_name"
 | 
				
			||||||
 | 
					        create_dummy_file "$file_path"
 | 
				
			||||||
 | 
					        echo "Created file: $file_path"
 | 
				
			||||||
 | 
					    done
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "Created $NUM_FILES dummy files for each extension in $TARGET_DIR"
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user