Sponsored Content
Full Discussion: String increment in UNIX
Top Forums Shell Programming and Scripting String increment in UNIX Post 302874223 by Chubler_XL on Thursday 14th of November 2013 01:01:00 PM
Old 11-14-2013
@fpmurphy - Nice solution, I like the shell conversion to dec I haven't come across that before.

A slight tweak is probably required to ensure that "ZZ" increments to "AAA":

Code:
   ((carry)) && new="A$new"
   echo $new

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how can i increment characters in unix.. ?

hi.. i am having some 3 files : ka, kb, kc i want to use these set of files in my script... how can i do that ? like first it should process "ka" .. then "kb".. then "kc" ... thanks, Krips. (3 Replies)
Discussion started by: kripssmart
3 Replies

2. UNIX for Dummies Questions & Answers

increment numbers in several parts of a string

I know how to do produce this: string01 string02 string03 several different ways. But how do I do produce this (without getting lost in recursion): string01morestring100yetmore10 string02morestring101yetmore20 string03morestring102yetmore30 ...... (2 Replies)
Discussion started by: uiop44
2 Replies

3. UNIX for Dummies Questions & Answers

increment operators in unix

increment operators in unix (3 Replies)
Discussion started by: pratima.kumari
3 Replies

4. Shell Programming and Scripting

Bash shell script: Str(007) to int(7),increment it(8) & convert back to string(008)

Hi, I have the following requirement. There will be following text/line in a file (eg: search-build.txt) PRODUCT_VERSION="V:01.002.007.Build1234" I need to update the incremental build number (eg here 007) every time I give a build through script. I am able to search the string and get... (4 Replies)
Discussion started by: drwatson_droid
4 Replies

5. Shell Programming and Scripting

Increment a variable in unix bash

Hello There, I have been trying to increment the value of variable to 1, 2, 3 etc. but, it displays 1 1+1 1+1+1 ..... :wall: Could anyone help out with this? for i in *.* do s=`expr $s+1` echo $s j=$i$j mv $i $j done Any help is appreciated? (24 Replies)
Discussion started by: amrutha0303
24 Replies

6. Shell Programming and Scripting

How to cut the particular string and increment the rows?

Hi am using unix aix I have tried using awk but am getting only output = x ,its not incrementing next output set -A var1 vv qa za ct=0 i=3 while do var1=`echo ${var1}` count=`awk ' NR==$i++ {print;exit}' ${.txt} | cut -c5 ` echo $count let ct=ct+1 done (6 Replies)
Discussion started by: Venkatesh1
6 Replies

7. Shell Programming and Scripting

How to increment a string variable?

Hi All, I am new to this forum and a novice at shell script. I am trying to write a script to determine each of the NIC configured on a linux system and its speed and Duplex. I came up with the following piece of code: echo `ifconfig -a | grep eth > /home/a/nic.txt` i=`awk -F, '{print... (4 Replies)
Discussion started by: pravin883
4 Replies

8. Shell Programming and Scripting

Find and increment at each occurence of string (loop)

I created script (sh shell) to generate vlc playlist based on some data files. All works fine so far except one string I do not know how to handle with. VLCSTART='<vlc:id>' VLCV=0 VLCEND='</vlc:id>' echo -e $'\n'$'\t'$'\t'$'\t'$'\t'\$VLCSTART$VLCV$VLCENDOutput file contains several occurences... (10 Replies)
Discussion started by: TiedCone
10 Replies

9. Shell Programming and Scripting

Find and increment value in string of hex

I have a long string of hex (from ASN.1 data) where I need to find and change a particular hex value only and increment it. The hex pairs either side (84 and a7) of the value to increment will remain constant. i.e. "84 <length> <value_to_increment> a7" starting with 00. So end result: ... (11 Replies)
Discussion started by: securegooner
11 Replies

10. UNIX for Beginners Questions & Answers

Search partial string in a file and replace the string - UNIX

I have the below string which i need to compare with a file and replace this string in the file which matches closely. Can anyone help me on this. string(Scenario 1)- user::r--,user::ourfrd:r-- String(Scenario 2)- user::r-- File **** # file: /local/Desktop/myfile # owner: me # group:... (6 Replies)
Discussion started by: sarathy_a35
6 Replies
NICE(1) 						      General Commands Manual							   NICE(1)

NAME
nice, nohup - run a command at low priority (sh only) SYNOPSIS
nice [ -number ] command [ arguments ] nohup command [ arguments ] DESCRIPTION
Nice executes command with low scheduling priority. If the number argument is present, the priority is incremented (higher numbers mean lower priorities) by that amount up to a limit of 20. The default number is 10. The super-user may run commands with priority higher than normal by using a negative priority, e.g. `--10'. Nohup executes command immune to hangup and terminate signals from the controlling terminal. The priority is incremented by 5. Nohup should be invoked from the shell with `&' in order to prevent it from responding to interrupts by or stealing the input from the next per- son who logs in on the same terminal. FILES
nohup.out standard output and standard error file under nohup SEE ALSO
csh(1), setpriority(2), renice(8) DIAGNOSTICS
Nice returns the exit status of the subject command. BUGS
Nice and nohup are particular to sh(1). If you use csh(1), then commands executed with ``&'' are automatically immune to hangup signals while in the background. There is a builtin command nohup which provides immunity from terminate, but it does not redirect output to nohup.out. Nice is built into csh(1) with a slightly different syntax than described here. The form ``nice +10'' nices to positive nice, and ``nice -10'' can be used by the super-user to give a process more of the processor. 4th Berkeley Distribution May 8, 1986 NICE(1)
All times are GMT -4. The time now is 07:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy