Sponsored Content
Top Forums UNIX for Beginners Questions & Answers "Revision up" instead of version up Post 303041294 by scribling on Wednesday 20th of November 2019 03:30:32 PM
Old 11-20-2019
Hey, I got lucky and worked it out myself. I thought it would be harder.


Code:
#!/bin/sh

for file in "$@"
do
        ext=${file##*.}
        base=${file%.*}
        num=${base##*[r_]}
        base=${base%$num}
        num=$((10#$num+1))
        new=$(printf '%s%02d.%s' "$base" "$num" "$ext")
        cp -nv "$file" "$new"
done

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Solaris

Who has "Solaris 10 Advanced System Administration(SA-202-S10)" latest revision doc?

Dear All, I am going to examine SA202 but I got SA-202-S10 revision A.1 so it might be out of date. Who has "Solaris 10 Advanced System Administration(SA-202-S10)" latest revision document? Could you share it ? Thank you in advance (2 Replies)
Discussion started by: unitipon
2 Replies

3. AIX

"pconsole" and "esaadmin" on AIX version 6

Anyone know what is the function of user "pconsole" and "esaadmin" on AIX version 6? (1 Reply)
Discussion started by: ebab3
1 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Solaris

The slices "usr", "opt", "tmp" disappeared!!! Help please.

The system don't boot. on the screen appears following: press enter to maintenance (or type CTRL-D to continue)...I checked with format command. ... the slices "0-root","1-swap","2-backup" exist. ...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies

6. UNIX for Dummies Questions & Answers

What is the significance of sh -s in ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh?

Please can you help me understand the significance of providing arguments under sh -s in > ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Discussion started by: Sree10
4 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
SVN::Web::Revision(3pm) 				User Contributed Perl Documentation				   SVN::Web::Revision(3pm)

NAME
SVN::Web::Revision - SVN::Web action to view a repository revision SYNOPSIS
In config.yaml actions: ... revision: class: SVN::Web::Revision opts: max_diff_size: 200_000 show_diff: 1 # or 0 ... DESCRIPTION
Shows information about a specific revision in a Subversion repository. CONFIGURATION
The following configuration options may be specified in config.yaml. max_diff_size If showing the diff (see "show_diff"), this determines the maximum size of the diff that will be shown. If the size of the generated diff (in bytes) is larger than this figure then it is not shown. Defaults to 200,000 bytes. show_diff Boolean indicating whether or not a diff of every file that was changed in the revision should be shown. Defaults to 1. OPTIONS
rev The revision to show. If not provided then use the repository's youngest revision. TEMPLATE VARIABLES
context Always "revision". rev The revision that is being shown. youngest_rev The repository's youngest revision. This is useful when constructing "next revision" and "previous revision" links. date The date on which the revision was committed, formatted according to "Time and date formatting" in SVN::Web. author The revision's author. msg The log message associated with this revision. paths A hash of hash refs. Each key is a path name. The value is a further hash ref with the following keys. isdir A boolean value, true if the given path is a directory. diff A SVN::Web::DiffParser object representing the diff. This may be undef, if the generated diff was larger than "max_diff_size" or if "show_diff" is false. diff_size The size of the generated diff (before parsing). max_diff_size The configured maximum diff size. action A single letter indicating the action that carried out on the path. A file was either added "A", modified "M", replaced "R", or deleted "D". copyfrom If the file was copied from another file then this is the path of the source of the copy. copyfromrev If the file was copied from another file then this is the revision of the file that it was copied form. EXCEPTIONS
(revision %1 does not exist) The given revision does not exist in the repository. COPYRIGHT
Copyright 2003-2004 by Chia-liang Kao "<clkao@clkao.org>". Copyright 2005-2007 by Nik Clayton "<nik@FreeBSD.org>". This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.14.2 2012-06-11 SVN::Web::Revision(3pm)
All times are GMT -4. The time now is 03:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy