Reputation: 301
How can we use wildcard characters while running system command in Perl Script. For example using *.src to edit a file with sed - something like :
system("sed -i -e 's/foo/bar/g' $baseDirPath/*.src");
It gives an error: sed: can't read /home/test/*.src: Not a Directory
Here, $baseDirPath is initialized to /home/test
Upvotes: 0
Views: 581
Reputation: 121
Try to chomp the variable $baseDirPath
before using it, As the line you have written should just work.
Upvotes: 1