Sponsored Content
Full Discussion: return IP address
Top Forums UNIX for Dummies Questions & Answers return IP address Post 302248918 by drl on Monday 20th of October 2008 06:14:47 AM
Old 10-20-2008
Hi.

Some versions of cut allow this:
Code:
#!/bin/bash -

# @(#) s1       Demonstrate sub-string extraction, character replacement.

echo
echo "(Versions displayed with local utility \"version\")"
version >/dev/null 2>&1 && version "=o" $(_eat $0 $1) cut sed
set -o nounset

echo
echo " Results:"
echo "192.29.0.131" |
cut -d"." -f3- |
sed -e 's/\./_/;s/^/_/'

exit 0

Producing:
Code:
% ./s1

(Versions displayed with local utility "version")
Linux 2.6.11-x1
GNU bash 2.05b.0
cut (coreutils) 5.2.1
GNU sed version 4.1.2

 Results:
_0_131

The GNU and Solaris cut seem to accept this ... cheers, drl
 

10 More Discussions You Might Find Interesting

1. IP Networking

pine username return address

hello all I am happily using pine but unhappily sending email as username@where.my.mail.works instead of ****@my.college.edu well, my username on my computer is one thing, but my username on my college account (**** here) is different. what I'm trying to do is use the college server for... (1 Reply)
Discussion started by: plusran
1 Replies

2. Programming

Return IP address

Not sure whether this is an appropriate request, however, Using C++ code I'm running a unix command from the pc that needs the IP address of the PC in order to set the DISPLAY variable. The code is written using Builder C++ (Borland) but I'm having difficulty finding what functions / header... (3 Replies)
Discussion started by: gefa
3 Replies

3. UNIX for Dummies Questions & Answers

to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's

Hi All, Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'. I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies

4. Shell Programming and Scripting

Read Hostname and Return IP Address

Dear Experts, I have a text file on my itanium box which contains list of nearly 1000 hostnames. I do not have the IP Address of them. I want read each entry from the text file and want to do a nslookup to the DNS Server and get the IP Adresses and put them in another file in the format... (1 Reply)
Discussion started by: PrasannaKS
1 Replies

5. UNIX for Dummies Questions & Answers

Panic kernal-mode address fault on user address 0x14

:) Firstly Hi all!!, im NEW!! and on here hoping that someone might be able to offer me some help... i have a server that keeps crashing every few days with the error message: PANIC KERNAL-MODE ADDRESS FAULT ON USER ADDRESS 0X14 KERNAL PAGE FAULT FROM (CS:EIP)=(100:EF71B5BD) EAX=EF822000... (10 Replies)
Discussion started by: Twix
10 Replies

6. Shell Programming and Scripting

Validate an IP address - Return to menu

hi! I need a script that, among other things, presents a menu to the user, checks the user input for an IP address (in quad dotted notation), and then "redirects" (with sed) that IP address to the Firewall script. The script must check that all of the inputs are valid IP addresses (numeric,... (1 Reply)
Discussion started by: zetetic
1 Replies

7. Shell Programming and Scripting

Need to get return code from mutt if an address is invalid/undeliverable from Unix shell script

I am using mutt on ksh Unix to send emails to addresses plucked from the database. If the "To:" email address is not longer valid and so the email is not sent to the "To:" recipient, but is sent to the valid cc address, I need to be able to get an error code returned to the shell script so that... (3 Replies)
Discussion started by: jzuber
3 Replies

8. IP Networking

Set default return address for all mails sent from mailx

Hi, I have a question about mailx in Red Hat: If I use 'mail userid@mydomain.com -- -f root@mydomain.com', the return mail address will be root@mydomain.com. How can I make all mails sent from this system use root@mydomain.com as return address by default? Thank you in advance! nz (1 Reply)
Discussion started by: aixlover
1 Replies

9. UNIX for Advanced & Expert Users

C program to detect duplicate ip address if any after assigning ip address to ethernet interface

Hi , Could someone let me know how to detect duplicate ip address after assigning ip address to ethernet interface using c program (3 Replies)
Discussion started by: Gopi Krishna P
3 Replies

10. Shell Programming and Scripting

Return: can only `return' from a function or sourced script

Not sure where the problem is. I can run the script without any issue using the following command. . /opt/app/scripts/cdc_migration.sh But it fails with the below error when I try it this way /opt/app/scripts/cdc_migration.sh /opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies
IPW(4)							   BSD Kernel Interfaces Manual 						    IPW(4)

NAME
ipw -- Intel PRO/Wireless 2100 IEEE 802.11 driver SYNOPSIS
ipw* at pci? dev ? function ? DESCRIPTION
The ipw driver provides support for the Intel PRO/Wireless 2100 MiniPCI network adapter. The Intel firmware requires acceptance of the End User License Agreement. The full license text can be found in /lib- data/firmware/if_ipw/LICENSE. The license is agreed to by setting the sysctl variable hw.ipw.accept_eula to 1. By default, the ipw driver configures the adapter for BSS operation (aka infrastructure mode). This mode requires the use of an access point. For more information on configuring this device, see ifconfig(8). EXAMPLES
Join an existing BSS network (i.e.: connect to an access point): ifconfig ipw0 inet 192.168.0.20 netmask 0xffffff00 Join a specific BSS network with network name ``my_net'': ifconfig ipw0 inet 192.168.0.20 netmask 0xffffff00 nwid my_net Join a specific BSS network with 64 bits WEP encryption: ifconfig ipw0 inet 192.168.0.20 netmask 0xffffff00 nwid my_net nwkey 0x1234567890 Join a specific BSS network with 128bits WEP encryption: ifconfig ipw0 inet 192.168.0.20 netmask 0xffffff00 nwid my_net nwkey 0x01020304050607080910111213 DIAGNOSTICS
ipw%d: device timeout The driver will reset the hardware. This should not happen. SEE ALSO
an(4), awi(4), pci(4), wi(4), ifconfig(8), ipwctl(8) The IPW Web Page, http://damien.bergamini.free.fr/ipw/. AUTHORS
The ipw driver and this man page were written by Damien Bergamini <damien.bergamini@free.fr>. BSD
November 7, 2008 BSD
All times are GMT -4. The time now is 01:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy