I have a text file with multiple rows. In every row I have the date in the following format:12/2/201515/9/201308/3/201102/5/2005...I want to create a folder for every line in this text file using a simple for loop as follows:#!/bin/bash -ffor f in $(cat ./file.txt ); do mkdir ${f}doneThis code didn't work because I have the character / in the date format.How can I create the folders and remove this character from the folder name at the same time? So the output folders names will be like this:1222015159201308320110252005...
Remove characters while naming files or folders
bash;text processing
You can use a command like this:sed -e 's/\///g' < file.txt | xargs mkdirThe sed command will strip the newlines from file.txt and the pipe to xargs will run mkdir for each line in the file.  An equivalent command (suggest by don_crissti) using tr instead of sed is:tr -d / < file.txt | xargs mkdir