For your latest request - increment the last number in the file names - , on top of the "parameter expansion" proposed by bakunin, "arithmetic expansion" could help. Its syntax is (( variable / constant / operator ... )), and it can be mixed with other expansions. For the first two of your sample data, this might work:
As the structure of the other names is different, above simple approach will fail, and it needs to be adapted, but mayhap you have a good starting point from it.
Hi,
I would like to learn shell scripting in UNIX. Can any one please give me the support and share the information/documents with me.
If any documents please post it to aswanikumar_nimmagadda@yahoo.co.in
Thanks in advance...!!! (3 Replies)
Hi Experts,
Here is what I am trying to do.
1) say I have a file with below strings
database1
database2
database3
data10gdb1
data10gdb2
databasewithoutdigit
2) I want to get the below output.
(- if there is any digit at the end of the string, I need to remove it)
(- Any... (3 Replies)
Hi all,
i have such string stored in a variable
var1 = 00000120
i want the o/p
var1 = 120
is it possible to have such o/p in ksh/bash ...
thanx in advance for the help
sonu (3 Replies)
Hi
I am new to world on unix scripting so any assistance would be gratefully appreciated,
I am trying to write a script which reads through a file, reads in line by line, searches for a pattern, copies string after it and then to do a search and replace elsehwere in the line,
so the... (7 Replies)
Hi there, im sure this is really simple but i have some strings like this
e1000g123001
e1000g0
nge11101
nge3and i want to create two variables ($DRIVER and $INSTANCE). the first one containing the alpha characters that make up the first part of the string, e.g. e1000g or nge and the... (9 Replies)
Hi,
How to add trailer record at the end of the flat file in the unix ksh shell scripting
can you please let me know the procedure
Regards
Srikanth (3 Replies)
Hi
I have a very large data file with several hundred columns and millions of lines.
The important data is in the last set of columns with variable numbers of tab delimited fields in front of it on each line.
Im currently trying sed to get the data out - I want anything beetween :RES and... (4 Replies)
My input is as below :
/splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt
/splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt
/splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt
/splunk/scrubbed/triumph/ifind.triumph.txt
From the above input I want to extract the file names only .
Basically I want to... (5 Replies)
Hello,
I have a log file with logs such as
01/05/2017 10:23:41 : file.log.38: database error, MODE=SINGLE, LEVEL=critical, STATE: 01170255 (mode main
how can i use perl to extract the 8-digit number below from the string
01170255
Thanks (7 Replies)
Discussion started by: james2009
7 Replies
LEARN ABOUT DEBIAN
shtool-version
SHTOOL-VERSION.TMP(1) GNU Portable Shell Tool SHTOOL-VERSION.TMP(1)NAME
shtool-version - GNU shtool maintain version information file
SYNOPSIS
shtool version [-l|--language lang] [-n|--name name] [-p|--prefix prefix] [-s|--set version] [-e|--edit] [-i|--increase knob] [-d|--display
type] file
DESCRIPTION
This command displays and maintains version information in file.
The version is always described with a triple <version,revision,level> and is represented by a string which always matches the regular
expression ""[0-9]+.[0-9]+[sabp.][0-9]+"".
The hexadecimal format for a version "v.rtl" is "VVRRTLL" where "VV" and "RR" directly correspond to "v" and "r", "T" encodes the level
type as 9, 2, 1, 0 (representing "s", "p"/".", "b", "a" in this order) and "LL" is either directly corresponding to "l" or set to 99 if
level type is "s".
OPTIONS
The following command line options are available.
-v, --verbose
Print verbose information during processing.
-l, --language lang
Choose format of version file file. lang=""txt"", ANSI C (lang="c"), M4 (lang="m4"), Perl (lang="perl") or Python (lang="python").
Default is "txt".
-n, --name name
Name the program the version is maintained for. Default is "unknown".
-p, --prefix prefix =item -s, --set version
Set the version to version.
-e, --edit
Interactively enter a new version.
-i, --increase knob
When option ``-i'' is used, the current version in file is updated by increasing one element of the version where knob can be one of
the following: ``"v"'' for increasing the version by 1 (and resetting revision and level to 0), ``"r"'' for increasing the revision by
1 (and resetting level to 0) or ``"l"'' for increasing the level by 1.
-d, --display type
Control the display type: ""short"" for a short version display, ""long"" for a longer version display, ""hex"" for a hexadecimal
display of the version and ""libtool"" for a format suitable for use with GNU libtool.
EXAMPLE
# shell script
shtool version -l c -n FooBar -p foobar -s 1.2b3 version.c
# configure.in
V=`shtool version -l c -d long version.c`
echo "Configuring FooBar, Version $V"
HISTORY
The GNU shtool version command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1994 for OSSP eperl. It was later
rewritten from scratch for inclusion into GNU shtool.
SEE ALSO shtool(1).
18-Jul-2008 shtool 2.0.8 SHTOOL-VERSION.TMP(1)