LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-10-2016, 05:36 PM   #1
thiagofw
Member
 
Registered: Jul 2016
Location: Minas Gerais, Brazil
Distribution: Slackware 14.2
Posts: 42

Rep: Reputation: Disabled
Insert value of variable using '( cat <<<'EOF' text here )> $newvar || What's wrong with me?


Hello,
I am completing a script and I have a question.
I have some variables to configure ips, dns, network mask and gateway.
Problem is that at the end of the routine, and try to insert the values ​​of the script already into the variables to be used it only saves the "own variables."
Example below:

$progconf=dir interfaces in debian and archive.


Can anyone tell me if I can send the variables with the values ​​of ips and mask sub networks within the "EOF"?
Thanks for listening!

Last edited by thiagofw; 12-10-2016 at 07:15 PM.
 
Old 12-10-2016, 05:52 PM   #2
thiagofw
Member
 
Registered: Jul 2016
Location: Minas Gerais, Brazil
Distribution: Slackware 14.2
Posts: 42

Original Poster
Rep: Reputation: Disabled
[QUOTE=thiagofw;5640429]Hello,
I am completing a script and I have a question.
I have some variables to configure ips, dns, network mask and gateway.
Problem is that at the end of the routine, and try to insert the values ​​of the script already into the variables to be used it only saves the "own variables."
Example below:

$progconf=dir interfaces in debian and archive.


Hello,


I use cat << EOF and the problem solved.

thanks.

Last edited by thiagofw; 12-10-2016 at 07:16 PM.
 
Old 12-10-2016, 10:53 PM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,860
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Cool. Next time please use [code] and [/code] tags when quoting code.

Last edited by NevemTeve; 12-11-2016 at 08:34 AM.
 
Old 12-11-2016, 07:56 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
I am wondering if you might shown an actual example of your solution, as both the original question and follow up post seem to make little sense.

My problems with understanding are as follows:

1. '( cat <<<'EOF' text here )> $newvar || - - This information was in the original subject line but used nowhere in the original post, so not really sure why it was mentioned?

2. $progconf=dir interfaces in debian and archive. - - Assuming bash (could be why I am confused), this line is not valid for multiple reasons

3. I use cat << EOF - - On its own this information is of little use. You have started a here document ... to do what?


Try and remember that people may search and find your question and might wish to use your solution, but currently I am not sure whether anyone would understand what they are using it for and what they are actually using??
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cat << EOF > help , when copy file with $variable to other file dr.x Linux - Server 3 04-25-2015 08:50 AM
[SOLVED] cat > filename << "EOF" syntax explanation bucovaina78 Linux - General 4 12-21-2011 03:50 PM
question about text/source files: what is the EOF indicator? rahul8705 Linux - General 2 11-10-2010 11:36 AM
how to cat a text file and save it as a variable mrobertson Programming 37 07-05-2005 08:20 AM
bash redirection "$ cat << EOF > file" (how does this work) ninmonkeys Linux - General 1 11-09-2004 03:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:43 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration