• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding a variable value to the text file

 
Pavan Math
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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 ?
 
Ivan Jozsef Balazs
Rancher
Posts: 981
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sed 's/"$l_shipment_number",/'

The sed program seems broken?: there is no closing /
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic