Search This Blog

Bash: for loop

#!/bin/bash

# backup IFS
IFSBAK=$IFS
IFS=$(echo -en "\n\b")

for f in $(ls)
do
    echo "$f"
done

# restore IFS
IFS=$IFSBAK

No comments:

Post a Comment