• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Adding a variable value to the text file

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

New to shell scripting.
I have a .txt file with values

1,abc,123,
2,xyz,456,

My requirement is to pick a column value from database and add it to the .txt file values

say 1,abc,123,sh1-123,
2,xyz,456,sh1-123,

Right now I am using
sed 's/"$l_shipment_number",/' <file_name>

where l_shipment_number=`sqlplus -s $FCP_LOGIN <<!!
SET head off
SET feed off
SET term off
SELECT DISTINCT shipment_number
FROM table
WHERE processed_file_name = <>
EXIT;
!!`

Now, I am not getting the value as needed in such a case.
Can you please let me know what the issue here is ?
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sed 's/"$l_shipment_number",/'

The sed program seems broken?: there is no closing /
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic