Replace integer string in a variable based on month?
Hi Folks -
Linux Version = Linux 2.6.39-400.128.17.el5uek x86_64
I have a process that determines the start and end load periods for an Oracle data load process.
The variables used are as follows follows:
Quote:
_STARTPOV
_ENDPOV
They are populated like such:
Quote:
_STARTPOV=9-18
_ENDPOV=10-18
However, the load requires the month to be the 3 digit format rather than number format. Therefore, to get around it, I am using a cut methodology but I w wondering if I'm over complicating things and there is an easier way?
Thank you!!
Last edited by SIMMS7400; 11-12-2018 at 05:18 AM..
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)
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)
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)
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)
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)
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)
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)
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)