Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Replace integer string in a variable based on month? Post 303025788 by RudiC on Monday 12th of November 2018 10:11:10 AM
Old 11-12-2018
Hmmm - how do you expect people to debug any code without giving any context? What's your code? How is it called? What's the contents of the local / temporary variables? What's your shell version?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Converting a String variable into Integer

Hi, I am passing a variable to a unix function. However when I try to assign the value to another variable like typeset -i I_CACHE_VAL=$2 Is this because of String to Integer conversion? I get an error. Please help me with thsi. Thanks (2 Replies)
Discussion started by: neeto
2 Replies

2. Shell Programming and Scripting

Using sed to replace a string in file with a string in a variable that contains spaces

Hi, i call my shell like: my_shell "my project name" my script: #!/bin/bash -vx projectname=$1 sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp cp temp test_config_doxy the following error occurres: sed s/'PROJECT_NAME ... (2 Replies)
Discussion started by: vivelafete
2 Replies

3. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

Can someone tell me how I can do this? e.g: a=$(echo -e wert trewt ertert ertert ertert erttert erterte rterter tertertert ert) How do i replace the STRING with $a? I try this: sed -i 's/STRING/'"$a"'/g' filename.ext but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies

4. Shell Programming and Scripting

how to compare string integer with an integer?

hi, how to I do this? i="4.000" if ; then echo "smaller" fi how do I convert the "4.000" to 4? Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies

5. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

6. Shell Programming and Scripting

Converting Month into Integer

okay so i run an openssl command to get the date of an expired script. Doing so gives me this: enddate=Jun 26 23:59:59 2012 GMT Then i cut everything out and just leave the month which is "Jun" Now the next part of my script is to tell the user if the the certificate is expired or not... (6 Replies)
Discussion started by: shade917
6 Replies

7. Shell Programming and Scripting

Moving files based on size (string to integer)

I have a log file that I want to archive out as it reaches 100MB. I am using the following to get the file size into a variable but get the error "line 5: filesize=$(wc -c < logfile.log) if then echo "is greater than 100M" else echo "is less than 100M" fi I'm sure there's something... (2 Replies)
Discussion started by: Flakman
2 Replies

8. Shell Programming and Scripting

Find and replace string based on entries on another file

I have a file1 with different with multiple fields and records File2 has 2 fields. I want to find and replace strings in file1 based on file2 values (I Want an exact match i.e. for example: when searching for DT:3, Substr of DT:34 should not be matched) File2: DT:3 foo_err DT:34 bar_frr... (8 Replies)
Discussion started by: aydj
8 Replies

9. Shell Programming and Scripting

Replace variable value in first file based on records in second

Hello , I have below files a) File A <?xml version="1.0" encoding="UTF-8" standalone="no"?> <root xmlns="http://aaa/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema" version="2.0"> <project name="source"> <mapping name="m_Source"> <parameter... (3 Replies)
Discussion started by: Pratik4891
3 Replies

10. Shell Programming and Scripting

Replace a string based on input

I am trying to read a value from a mapping file and would need to replace the value based on country parameter source_table_@ctry_final Expected final_var=source_table_aus_final If the country is in nz,usa,uk then final_var=diff_table_nz_final final_var=diff_table_usa_final like that... (10 Replies)
Discussion started by: Master_Mind
10 Replies
LOADWATCH(1)						      General Commands Manual						      LOADWATCH(1)

NAME
loadwatch - run a program when machine is idle SYNOPSIS
loadwatch [options] -p pid | [--] prog [args] DESCRIPTION
loadwatch either spawns a child process prog with the arguments args and controls it with all its process group, or takes control of an already running process with pid pid with all its process group. loadwatch allows the controlled processes to run while the load average remains below high_limit. Every delay seconds, loadwatch checks the load average. If the load is above high_limit, the child is suspended; the child is resumed when the load falls below low_limit. OPTIONS
A summary of options is included below. -h high_limit A decimal value that sets the system load at which the child process will be suspended. (Default: 1.25) -l low_limit A decimal value that sets the system load at which the child process will be resumed. (Default: 0.25) -d delay An integral number of seconds that sets how often the system load will be checked. (Default: 10) -n copies An integer value that sets the number of copies of prog to run. (Default: 1) -u file Create a UNIX domain socket file for use by lw-ctl. -p pid The pid of the program that should be controlled by loadwatch (with all its process group). SEE ALSO
lw-ctl(1), nice(1) BUGS
You should choose low_limit and high_limit carefully. When the load drops below low_limit, the process(es) will be resumed, and it should not, by itself, cause the load to raise above high_limit, or the whole will oscillate, periodically suspending and resuming the process(es). Similarly, if several instances of loadwatch are running, they may resume their processes at the same time, leading to oscillations if the limits are not carefully chosen. Hence, each instance of loadwatch affects every other instance on the computer, and should not be consid- ered in isolation. AUTHOR
This manual page was written by Dale E. Martin <dmartin@debian.org>, for the Debian GNU/Linux system (but may be used by others). It was then updated by Nicolas Boullis <nboullis@debian.org>. July 2003 LOADWATCH(1)
All times are GMT -4. The time now is 08:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy