LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-04-2005, 06:58 AM   #1
tpreitano
LQ Newbie
 
Registered: Aug 2005
Posts: 7

Rep: Reputation: 0
adding text to lines in a file


I have this running when I log into one of my boxes......

env | egrep '(SSH_AUTH_SOCKET|SSH_AGENT_PID)' > cronenv

it reads......

SSH_AUTH_SOCKET=/tmp/XXXX/XXXX
SSH_AGENT_PID =XXXX

I want it to read(have added).....

SSH_AUTH_SOCKET=/tmp/XXXX/XXXX; export SSH_AUTH_SOCKET;
SSH_AGENT_PID=XXXX; export SSH_AGENT_PID;


Thanks Ahead.
TPR
 
Old 10-04-2005, 08:32 AM   #2
cardy
Member
 
Registered: Jan 2005
Location: Shropshire, England, UK
Distribution: RedHat, Fedora, CentOS..........
Posts: 121

Rep: Reputation: 19
You should be able to use the code below to make the changes.

Code:
env | egrep '(SSH_AUTH_SOCK|SSH_AGENT_PID)' | sed 's/\(.*\)=\(.*\)/\1=\2; export \1;/g' >cronenv

Last edited by cardy; 10-04-2005 at 10:07 AM.
 
Old 10-04-2005, 09:30 AM   #3
tpreitano
LQ Newbie
 
Registered: Aug 2005
Posts: 7

Original Poster
Rep: Reputation: 0
I almost didnt realized I typed SOCKET, not the correct SOCK.
Thanks, works great.

TPR
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grab text lines in text file LULUSNATCH Programming 1 12-02-2005 10:55 AM
Remove odd lines from a text file Mr. Gone Programming 2 09-19-2005 11:16 AM
adding text file browser Linux - General 5 09-09-2005 09:10 PM
How to filter lines from a text file Rascale Linux - Software 1 10-28-2003 12:46 PM
Loop over lines in text file? amaze Linux - General 2 08-12-2003 07:15 AM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration