Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • I would change that to for file in "/path/to/files/file*.txt" just to avoid this running a muck in the wrong directory. Commented Aug 31, 2017 at 14:19
  • ` bala@SMS:~/test1$ ls -l total 4 -rw-rw-r-- 1 bala bala 0 Aug 31 19:47 file1.txt -rw-rw-r-- 1 bala bala 0 Aug 31 19:47 file2.txt -rw-rw-r-- 1 bala bala 0 Aug 31 19:47 file3.txt -rw-rw-r-- 1 bala bala 49 Aug 31 19:41 new_test.sh bala@SMS:~/test1$ sh new_test.sh ‘file1.txt’ -> ‘new_file1.txt’ ‘file2.txt’ -> ‘new_file2.txt’ ‘file3.txt’ -> ‘new_file3.txt’ ‘new_test.sh’ -> ‘new_new_test.sh’ bala@SMS:~/test1$ ls new_file1.txt new_file2.txt new_file3.txt new_new_test.sh bala@SMS:~/test1$ ` Commented Aug 31, 2017 at 14:22
  • 2
    It's hard to read what you pasted there but I suppose it's working Commented Aug 31, 2017 at 14:26