Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by www.cyberciti.biz #
 
PREVIOUS NEXT
Tagged: #loop #bash #files
ADD COMMENT
Topic
Name
4+4 =