简体   繁体   中英

How to read the properties of all svn files using 'For' loop in shell script

I wanted to print the file names those are checked out from SVN and display the version history of each file.Am completely new to shell scripting and as a first step, I am trying to see the file names under a folder using the below piece of code.But it's just printing the text inside the echo and not the file names under the 'data' folder.There are images and other files. I wanted to read all of them .Some one Please help me here .Thanks!

#!/bin/bash

for FILE in /root/test/data/* ; do
           echo "Processing ${FILE} file..."
done

Output : $ ./sample.sh Processing /root/test/data/* file...

If that's bash, I would assume that /root/test/data either doesn't exist or it has no files inside. In such cases, bash would not expand and would use the exact same text you provided, which is what you see. Make sure the path you are providing for expansion is correct.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM