Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash loop over files in file

# Basic syntax:
for filename in `cat file_of_filenames.txt`; do
	echo $filename
done

# This iterates through each of the filenames listed in the 
#	file_of_filenames.txt
# Note, the filenames should be separated by spaces or new-lines
Comment

for loop in bash for files

#!/bin/bash
FILES=/path/to/*
for f in $FILES
do
  echo "Processing $f file..."
  # take action on each file. $f store current file name
  cat $f
done
Comment

PREVIOUS NEXT
Code Example
Shell :: setup virtualenv python windows 
Shell :: how to prevent ubuntu from sleeping when lid is closed 
Shell :: bash escape special characters in variable 
Shell :: kubectl neat not found 
Shell :: how to stop a port in macos 
Shell :: run zipkin-server on docker 
Shell :: cancel rebase git 
Shell :: mac xterm download 
Shell :: installing plesk on linux 
Shell :: how to install heroku cli 
Shell :: how to download a text file with curl 
Shell :: how toinstall npm on manjaro 
Shell :: fork bomb linux 
Shell :: install rasa 
Shell :: why jupyter notebook suggestions not showing after upgrade 
Shell :: how to get list of files in a folder in batch script 
Shell :: move view vim 
Shell :: delete registry key powershell 
Shell :: terminal remove files starting with 
Shell :: install scrollmagic npm 
Shell :: export bigquery scheam 
Shell :: how to change the web default browser in linux 
Shell :: docker remove unused 
Shell :: copy local docker image to kind cluster 
Shell :: windows start stop service 
Shell :: How do I run multiple commands on one line in PowerShell? 
Shell :: download code from github 
Shell :: git origin command 
Shell :: Google Chrome freeze uploading a file ubuntu 22.04 
Shell :: Checking for an existing ssh key 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =