Sponsored Content
Top Forums Programming How to decrease a string number by one in C? Post 302511319 by omega666 on Wednesday 6th of April 2011 12:36:04 PM
Old 04-06-2011
Error How to decrease a string number by one in C?

If i have a macro called NUM which is "8" (string) for example
How do I make it into say "7", well i just want to lower it by one, also there will never be the case where its "0" and i have to decrease it.
there is no guarantee how many digits NUM could have, but will always be an integer.
How do I do the conversion?
 

10 More Discussions You Might Find Interesting

1. Solaris

increase/decrease filesystem

Hi All, I need to increase the filesystem of / and /var (two different slices)? Space will be coming from /home slice so I need to decrease it. Is that possible without reinstallation or in a single-user-mode? Any idea or link please. Thanks in advance. (5 Replies)
Discussion started by: itik
5 Replies

2. Shell Programming and Scripting

How to decrease the font size in Mailx

Hi all, I am using echo "$EMAILMESSAGE" | mailx -s "$SUBJECT" -b $CC "$TO" I am receiving the mail but seems to big in font size. Is there any option mailx to decrease the size of the mail generated. Thanks, (1 Reply)
Discussion started by: shellscripter
1 Replies

3. Linux

Decrease Mouse Sensitivities

Hey guys, I have a HP Pavilion laptop, and in order to preserve it's lifespan; I decided to use an external mouse and keyboard whilst at my desk. It worked right away - I was really impressed. I expected to have to recompile the kernel. Anyway, the only thing is that the mouse is... (1 Reply)
Discussion started by: newbie sarah
1 Replies

4. Solaris

How to increase or decrease inode number of the particular UFS filesystem

Hi Gurus I want to know the command & tips regarding, how to increase or decrease inode number of the particular ufs filesystem. Is it possible to do it in a live/production environment. Regards (3 Replies)
Discussion started by: girish.batra
3 Replies

5. Shell Programming and Scripting

decrease number by 1 in text file

i have text file which contains number like 234565 i need a shell script or command which decrease number by 1 in text file. pls (2 Replies)
Discussion started by: reyazan
2 Replies

6. Shell Programming and Scripting

changing number in bash (number is in form of string)

I have a txt file as database. when i run my program what it does is it ask me for 3 name and stored in the file as name1:name2:name3:1 when u enter 3 name it add those in file as above format and add 1 at the end. I what i want is if i enter same names again it changes that 1 to 2 and so... (3 Replies)
Discussion started by: Learnerabc
3 Replies

7. UNIX for Dummies Questions & Answers

Decrease buffer size

Hi, I am using the below command to get the output in a file called "Logs.txt" tail -f filename | egrep -i "cpu | hung " >> Logs.txt The problem is the Logs.txt file gets updated only after the buffer is 8Kb, but i want to update the file immediately and not wait for the buffer to get 8kb. Is... (8 Replies)
Discussion started by: @bhi
8 Replies

8. Shell Programming and Scripting

increase/decrease multiple numbers in a filename.

I got a game that output map tiles of the session with the 0,0 position at the place you login/spawn. That makes making a map somewhat troublesome since the 0,0 will move. So I've been looking for a way to change the numbers in the filenames of all files in a folder by a certain value. The... (5 Replies)
Discussion started by: Ravenholdt
5 Replies

9. AIX

[ASK] decrease/shrink the size of filesystem

Hello, I would like to reduce the size of filesystem online. We can do online for increase without any problem. So any risk can be occurred with the decrease? This is not an issue, just a discussion for decrease/shrink space with chfs command. My AIX system is version 6.1 and the filesystem... (2 Replies)
Discussion started by: Phat
2 Replies

10. UNIX for Beginners Questions & Answers

Concatenate a string and number and compare that with another string in awk script

I have below code inside my awk script if ( $0 ~ /SVC IN:/ ) { svc_in=substr( $0,23 , 3); if (msg_start == 1 && msg_end == 0) { msg_arr=$0; } } else if ( $0 ~ /^SVC OUT:/ ) { svc_out=substr( $0, 9, 3); if (msg_start == 1 && msg_end == 0) ... (6 Replies)
Discussion started by: bhagya123
6 Replies
GRUB-FSTEST(3)						     Library Functions Manual						    GRUB-FSTEST(3)

NAME
grub-fstest -- Debug tool for GRUB's filesystem driver. SYNOPSIS
grub-fstest [-c | --diskcount=NUM] [-C | --crypto] [-d | --debug=STRING] [-K | --zfs-key=FILE|prompt] [-n | --length=NUM] [-r | --root=DEVICE_NAME] [-s | --skip=NUM] [-u | --uncompress] [-v | --verbose] IMAGE_PATH <blocklist FILE | cat FILE | cmp FILE LOCAL | cp FILE LOCAL | crc FILE | hex FILE | ls PATH | xnu_uuid DEVICE> DESCRIPTION
grub-fstest is a tool for testing GRUB's filesystem drivers. You should not normally need to run this program. OPTIONS
--diskcount=NUM Specify the number of input files. --crypto Mount cryptographic devices. --debug=STRING Set debug environment variable. --zfs-key=FILE|prompt Load ZFS cryptographic key. --length=NUM Handle NUM bytes in output file. --root=DEVICE_NAME Set root device. --skip=NUM Skip NUM bytes from output file. --uncompress Uncompress data. --verbose Print verbose messages. COMMANDS
blocklist FILE Display block list of FILE. cat FILE Display FILE on standard output. cmp FILE LOCAL Compare FILE with local file LOCAL. cp FILE LOCAL Copy FILE to local file LOCAL. crc FILE Display the CRC-32 checksum of FILE. hex FILE Display contents of FILE in hexidecimal. ls PATH List files at PATH. xnu_uuid DEVICE Display the XNU UUID of DEVICE. SEE ALSO
info grub Wed Feb 26 2014 GRUB-FSTEST(3)
All times are GMT -4. The time now is 12:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy