| | |
Issue with sed and date variable - Suffix too large - 512 max
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Aug 2007
Posts: 34
Reputation:
Solved Threads: 0
Hi All
Facing issue with using sed and globally replacing a word with date variable for a sql file.
Any help would be appreciated.
Thanks
Facing issue with using sed and globally replacing a word with date variable for a sql file.
Any help would be appreciated.
Shell Scripting Syntax (Toggle Plain Text)
sed -e "s/DATEST\/$DATESTART/g" $SQLREAD > $SQLNEW sed -e "s/DATEST\/08/25/2009:07:41:41/g" /uat/ut21_sysmon/quest/foglight/JJ/jjsql Suffix too large - 512 max: s/DATEST\/08/25/2009:07:41:41/g
Thanks
Last edited by John A; Aug 26th, 2009 at 12:29 am. Reason: added code tags
•
•
Join Date: Aug 2007
Posts: 34
Reputation:
Solved Threads: 0
Hi Salem
I might of not explained it properly, what i pasted was the code and the output via set -v
The code in the script is this:
[sed -e "s/DATEST\/$DATESTART/g" $SQLREAD > $SQLNEW]
Basically my variable [$DATESTART = 08/25/2009:07:41:41] for example.
I need to keep the / in my date variable due to database requirements within the sql code. Is this causing the headache with Sed or is it possible to get round this, or could you suggest any other unix power tool?
Many thanks for your advice
I might of not explained it properly, what i pasted was the code and the output via set -v
The code in the script is this:
[sed -e "s/DATEST\/$DATESTART/g" $SQLREAD > $SQLNEW]
Basically my variable [$DATESTART = 08/25/2009:07:41:41] for example.
I need to keep the / in my date variable due to database requirements within the sql code. Is this causing the headache with Sed or is it possible to get round this, or could you suggest any other unix power tool?
Many thanks for your advice
Use a different separator.
Eg.
I can't figure out where the real separator is in the middle of the expression.
But you get the idea.
Eg.
Shell Scripting Syntax (Toggle Plain Text)
sed -e "s@DATEST\@$DATESTART@g"
But you get the idea.
![]() |
Similar Threads
- image procesing project (C)
- date selection for in jsp and date variable to be caught in servlet to insert in mysq (JSP)
- declaring a Date variable (Java)
- finding the max date in a record (MS SQL)
- samba 3.0.22 on solaris 9 (Getting Started and Choosing a Distro)
- tomorrow date??? . (PHP)
- Issue related to combobox.... (VB.NET)
- variable to handle large integer (C)
- Samba writing stall error; linux to linux transfer (*nix Software)
Other Threads in the Shell Scripting Forum
- Previous Thread: How not to show messages?
- Next Thread: date command
| Thread Tools | Search this Thread |






