Sponsored Content
Full Discussion: Echo with loop
Top Forums Shell Programming and Scripting Echo with loop Post 303011733 by nimafire on Tuesday 23rd of January 2018 03:43:56 AM
Old 01-23-2018
Echo with loop

Hello
i have a file with this format:

ip.txt content:
Code:
192.168.1.1/2020
192.136.1.2/2028
192.168.1.10/3047

....

need to create 1000 files and each files content, import data from ip.txt line (first file with first line data, second file with second line...etc)

Code:
internal=yes
internalip= (IP FROM FILE)
internal.dest: (IP FROM FILE) port=(PORT FROM FILE)

im confuses how add loop when try to echo.


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 01-23-2018 at 06:11 AM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Nested Loop to Echo Multiple Arrays

I have three arrays which hold three elements each. I have a fourth array which contains the names of those three arrays. I'm having difficulty creating a nested loop that can loop through each array and echo their values. script #!/bin/ksh # array of locations (usa, london, australia)... (1 Reply)
Discussion started by: yongho
1 Replies

2. Shell Programming and Scripting

Echo var1,var2,var3,var4,var5,var6 in loop help

Hello, I have created numerous variables called $mask1 $mask2... $maskN. I wish to echo these variables, below is the code for the two functions, the first creates the variables and the second echos them. It is the second function which does not work. The line (i believe to be wrong) is in... (1 Reply)
Discussion started by: rorey_breaker
1 Replies

3. Shell Programming and Scripting

Need a Command To display "echo command value in loop" in single line.

Hi I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below. Input file :test_1.txt a1|b1|4|5 a1|b1|42|9 a2|b2|32|25 a1|b1|2|5 a3|b3|4|8 a2|b2|14|6 Output file:test_2.txt... (2 Replies)
Discussion started by: sakthifire
2 Replies

4. UNIX for Dummies Questions & Answers

How to correctly use an echo inside an echo?

Bit of a weird one i suppose, i want to use an echo inside an echo... For example... i have a script that i want to use to take users input and create another script. Inside this script it creates it also needs to use echos... echo "echo "hello"" >$file echo "echo "goodbye"" >$file ... (3 Replies)
Discussion started by: mokachoka
3 Replies

5. UNIX for Dummies Questions & Answers

skipping echo stmnt first time a while loop entered

one more question. I want to skip the first echo statement the first time the loop gets entered while #keep prompting for more funds until selling price achieved do echo "You have inserted a total of ${total_inserted} cents. Please insert $total_remaining more cents" echo... (1 Reply)
Discussion started by: danieldcc
1 Replies

6. Shell Programming and Scripting

Script to loop line in a file and add info or do echo

I have a record.txt it will update weekly, and it could be 2 lines or more ... it just echo each line to the script san jose,23.34% tampa,2.15% dallas,30.20% seattle,44.29% Unknown,16.72% How do i write a shell script to give me a test.pl or bash file which contain #!/home/perl... (8 Replies)
Discussion started by: sabercats
8 Replies

7. Shell Programming and Scripting

Basic bash, echo in loop for

Hi, I am trying to make a script to manage log. I want to write the name of the .gz I moved and the date : for i in `ls $replog/*.gz` do echo " $i " `echo $i date +%d:%m:%Y` `echo $datee `>> $replog/mrnet.log mv $i /var/log/vieux-logs done I need to echo... (10 Replies)
Discussion started by: Dabless
10 Replies

8. Shell Programming and Scripting

BASH - Need to echo for loop output to one line

I'm trying to echo the release version of some of our Linux servers. Typically I do these types of things by "catting" a text file with the host names, "ssh-ing" to the host and running my string. This is what I've written for i in `cat versions.txt` ; do echo $i ; ssh $i cat /etc/issue |... (5 Replies)
Discussion started by: lombardi4851
5 Replies

9. Shell Programming and Scripting

Echo print on same line while loop using variable

Currently using below script but echo it print the output in two line. Input file all-vm-final-2.txt CEALA08893 SDDC_SCUN DS_SIO_Workload_SAPUI_UAT_01 4 CEALA09546 SDDC_SCUN DS-SIO-PD5_Workload_UAT_SP1_Flash_07 4 CEALA09702 SDDC_SCUN DS-VSAN-RMP-WORKLOAD01 4 DEALA08762 SDDC_LDC... (3 Replies)
Discussion started by: ranjancom2000
3 Replies

10. UNIX for Beginners Questions & Answers

Echo For ... Loop output into a file

Hi, All: I have one for ... loop code to generate a list of rename statement. However, echo the loop output on screen is OK. But store the echo output into a file is not working. So come here to seek help. My basic code is: ! /bin/ksh echo > DAS_VetFed.txt dir=/mydirectory cd $dir files=`ls... (6 Replies)
Discussion started by: duke0001
6 Replies
pydhcplib.ipv4(3)						     PYDHCPLIB							 pydhcplib.ipv4(3)

NAME
pydhcplib.ipv4 - Type for IP addresses version 4 SYNOPSIS
from pydhcplib.type_ipv4 import ipv4 a = ipv4() a = ipv4(string) a = ipv4(strlist) a = ipv4(int) DESCRIPTION
The class pydhcplib.ipv4 is a type "IP address version 4". It's used for string processing like "192.168.0.4". The class creation argument can be a string like "192.168.0.4". The class creation argument can be a list of bytes like [192,168,0,4]. METHODS
The implemented methods in this class are mostly methods of comparison (= =, >, etc...) else : str() return data converted into a printable string. list() return data converted into a list of bytes. int() return data converted into an 4 bytes int. EXAMPLES
Example program ipv4_example.py : from pydhcplib.type_ipv4 import ipv4 address = ipv4() address1 = ipv4("192.168.0.1") address2 = ipv4("10.0.0.1") address3 = ipv4([192,168,0,1]) print "a0 : ",address print "a1 : ",address1 print "a2 : ",address2 print "a3 : ",address3 if address1 == address2 : print "test 1 : ",address1, "==",address2 else : print "test 1 : " ,address1, "!=",address2 if address1 == address3 : print "test 2 : ", address1, "==",address3 else : print "test 2 : ", address1, "!=",address3 SEE ALSO
pydhcp(8), pydhcplib.hwmac(3), pydhcplib.ipv4(3), pydhcplib.strlist(3), pydhcplib.DhcpPacket(3), pydhcplib.DhcpBasicPacket(3), pydhc- plib.DhcpNetwork(3), pydhcplib.DhcpClient(3), pydhcplib.DhcpRawClient(3), pydhcplib.DhcpDerver(3) BUGS
See http://pydhcplib.tuxfamily.org/ for more information. AUTHOR
Mathieu Ignacio (mignacio[AT]april.org) pydhcplib.ipv4(3)
All times are GMT -4. The time now is 01:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy