#!/usr/bin/perl -w use diagnostics; use strict; use Cwd; my $dir = getcwd; my $path = "/home/test/mytest"; my %ext_map = ( '.img' => '_trn.img' ); opendir(BIN, $path) || die "cant open folder: $!"; my @array = grep { -d "$path" } readdir BIN; foreach my $file (@array) { my $new_ext = $ext_map{$ext} || $ext; my $new_filename = $old_filename . '_new' . $new_ext; symlink("$path/$old_filename$ext", "$path/$new_filename" ) || d +ie "cant create link: $!\n"; }
In reply to adding symbolic links with new name. by muizelaar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |