在linux中包含带有变量的rename命令中的数字

时间:2016-09-07 18:59:52

标签: linux rename

我正在尝试使用重命名重命名几个文件,但我在使用变量包含数字时遇到问题(如果这就是在这种情况下调用的那部分)。

我正在尝试将abc01d02.xxx重命名为rename -n -v 's/(.{3}).(.{3})(\.xxx)/$101$2$3/' *.xxx ,在c和1之间添加额外的0。

当我尝试这个时:

$101

尝试使用变量$1代替01,添加$2,然后添加$3/**********************************************************/ /* JS Google Map */ /**********************************************************/ function initMap() { var myLocation = new google.maps.LatLng(36.828800, -76.132800); var draggableValue; if($(document).width() <= 768){ draggableValue = false; } else{ draggableValue = true; } var mapOptions = { center: myLocation, zoom: 16, mapTypeControl: true, draggable: draggableValue, scaleControl: false, scrollwheel: false, styles: [ { "featureType": "landscape", "stylers": [ { "visibility": "on" }, { "color": "#555559" }, {lightness: 51} ] },{ "featureType": "poi", "stylers": [ { "visibility": "off" } ] },{ "featureType": "road", "stylers": [ { "color": "#555559" } ] },{ "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] },{ "featureType": "road", "elementType": "labels.text.fill", "stylers": [ { "visibility": "on" }, { "weight": 8 }, { "hue": "#ffffff" }, { "color": "#ffffff" } ] },{ "featureType": "landscape", "elementType": "labels.text.stroke", "stylers": [ { "color": "#ffffff" }, { "visibility": "on" } ] },{ "featureType": "poi", "elementType": "labels.icon", "stylers": [ { "visibility": "on" } ] },{ "featureType": "water", "elementType": "labels.text.fill", "stylers": [ { "visibility": "off" }, { "color": "#ffffff" } ] },{ "featureType": "water", "elementType": "labels.text.stroke", "stylers": [ { "visibility": "on" }, { "color": "#ffffff" } ] },{ "featureType": "water", "stylers": [ { "color": "#555559" }, {lightness: 25} ] },{ },{"stylers": [{"saturation": 0}]} ], streetViewControl: true /**/ }; var image = new google.maps.MarkerImage('/assets/images/icon.png', new google.maps.Size(500, 500), new google.maps.Point(0, 0), new google.maps.Point(30, 30), new google.maps.Size(60, 60) ); var shape = { coords: [1, 1, 1, 60, 60, 60, 60, 1], type: 'poly' }; var infowindow = new google.maps.InfoWindow({ pixelOffset: new google.maps.Size(0, 30), content: '<h5 class="map-header text-center">Header</h5><p class="text-center">Info window text</p>' }); var marker = new google.maps.Marker({ position: myLocation, icon: image, anchorPoint: new google.maps.Point(0, -60), title: 'Header' }); var map = new google.maps.Map(document.getElementById("map"), mapOptions); marker.setMap(map); marker.addListener('click', function() { infowindow.open(map, marker); }); } google.maps.event.addDomListener(window, 'load', initMap); /**********************************************************/ /* HTML Google Map */ /**********************************************************/ <section style="height:100%;"> <div class="map" id="map"> </div> </section> 。我还没弄明白如何打破变量中的01部分。

任何帮助都将不胜感激。

0 个答案:

没有答案