I have a shell script and want to assign a value to a variable. The value is the line exctrated from a file using the line number. The line number it is not fix, and could change any time.
I have tried sed, awk, head .. See my script
# Get randome line number from the file
#selectedline = `awk... (1 Reply)
Hello,
I am having trouble extracting a specific line from a file when the line number is known. My first attempt involved grep -n 'hi' (the word 'hi will always be there) to get the line number before the line that I actually want (line 4).
Extra Notes:
-I am working in a bash script.
-The... (7 Replies)
This is the line that I am using:
sed 's/^*\({3}*$\)/\1 /' <test.txt >results.txt
and suppose that test.txt contains the following lines:
http://www.example.com/200904/AUS.txt
http://www.example.com/200903/_RUS.txt
http://www.example.com/200902/.FRA.txt
What I expected to see in results.txt... (6 Replies)
FOLKS ,
i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one.
thanks...
Venu (3 Replies)
Dear all,
I am trying to extract a number from a line in one file (task 1), duplicate another file (task 2) and replace all instances of the strings 300, in duplicated with the extracted number (task 3). Here is what I have tried so far:
for ((k=1;k<4;k++)); do
temp=`sed -n "${k}p"... (2 Replies)
I have a LOG file which looks like this
Import started at: Mon Jul 23 02:13:01 EDT 2012
Initialization completed in 2.146 seconds.
--------------------------------------------------------------------------------
--
Import summary for Import item: PolicyInformation... (8 Replies)
Hi guys,
I have been trying to do this, but... no luck so maybe you can help me.
I have a line like this:
Total Handled, Received, on queue Input Mgs: 140 / 14 => 0
I need to, get the number after the / until the =, to get only 14 .
Any help is greatly appreciated.
Thanks, (4 Replies)
In the below perl code I am using tags within each line to extract certain information. The tags that are used are:
STB >0.8 is STRAND BIAS otherwise GOOD
FDP is the second number
GO towards the end of the line is read into an array and the value returned is outputed, in the first line that... (1 Reply)
Discussion started by: cmccabe
1 Replies
LEARN ABOUT OSX
internetsharing
InternetSharing(8) BSD System Manager's Manual InternetSharing(8)NAME
InternetSharing -- simple NAT/router configuration daemon
SYNOPSIS
InternetSharing -d
DESCRIPTION
InternetSharing is the back-end for the Internet Sharing feature. It is responsible for configuring the network interfaces, the DHCP server
bootpd(8), the network address translation daemon natd(8), and the Internet domain name server named(8). named(8) is run in caching-only
mode and allows the DHCP server to always offer the same DNS server address to the DHCP clients, regardless of the value of the actual DNS
server addresses.
The single command line option -d places additional debugging information to stdout/stderr.
InternetSharing is launched by launchd(8) both at start-up and when the user turns Internet Sharing on in the Sharing preferences pane.
By default, InternetSharing configures the IP addresses for non-AirPort interfaces starting at 192.168.2.1, walking up by one class C network
(subnet mask 255.255.255.0) for each subsequent interface i.e. 192.168.3.1, 192.168.4.1, 192.168.5.1, and so on. The AirPort interface by
default is assigned 10.0.2.1.
CONFIGURATION
InternetSharing reads the property list com.apple.nat.plist stored in the /Library/Preferences/SystemConfiguration.
Details of the com.apple.nat.plist are subject to change and are not completely documented here. The plist is a contract between the Sharing
preferences pane and InternetSharing. Any details provided here are for informational purposes only.
The plist is a dictionary with a single sub-dictionary called NAT containing properties to control which interfaces to use and other set-
tings. It may also have a sub-dictionary called AirPort that is used to configure the AirPort interface when it is put into access point
mode.
One property worth mentioning is SharingNetworkNumberStart. This property controls the behavior of InternetSharing when it configures IP
addresses for the local interfaces. The property is encoded as a string containing the dotted decimal network IP address, assumed to be a
class C network. For example:
<key>SharingNetworkNumberStart</key>
<string>192.168.100.0</string>
If the SharingNetworkNumberStart appears directly in the NAT dictionary, it controls the starting IP address chosen for the non-AirPort
interfaces. If the property appears within the AirPort sub-dictionary, it controls the IP address assigned to the AirPort interface.
The purpose of the property is to allow the user to avoid address collisions with existing NAT'd networks.
SEE ALSO bootpd(8), launchd(8), natd(8), named(8)Mac OS X Feburary 26, 2007 Mac OS X