Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help extracting MAC addresses from List Post 302161372 by dhs23 on Thursday 24th of January 2008 10:00:10 AM
Old 01-24-2008
Brilliant, thanks for that. Very helpful.Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Mac addresses of NICs (why are they the same)

I am training to be support on our solaris based network and was wondering why solaris seems to assign the same mac address to all NICs placed in the machine regardless of how many NICs are in there, when i do a ifconfig -a all nics have same MAC. Presumably this is a feature and there is... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

2. UNIX Desktop Questions & Answers

Using Mailx to send to list of email addresses

Im trying to use a shell script to send to a list of email addresses in a txt file. Here is what i have tried but it keeps sending to dead.letter... Success.ksh contains... mailx -s"Night Batch Success" 'cat /Scripts/email_addresses.txt' < /Scripts/email_body_message.txt The email body... (1 Reply)
Discussion started by: aguad3
1 Replies

3. Shell Programming and Scripting

Need help with IP and MAC addresses

Hi, i am working on a project where i have to write a script to find out MAC addresses of the systems with given IP address. Can anybody tell me which command i can use to find MAC address if you know IP address of the machine. Thanks (5 Replies)
Discussion started by: manmeet
5 Replies

4. Shell Programming and Scripting

Extracting email addresses from a flat file

All, I have a flat file which contains an email address in every line. I am trying to find a way to extract all the email addresses delimited by comma (,). Can you please show me a way, it will be very helpful, thanks. (3 Replies)
Discussion started by: sed_beginner19
3 Replies

5. UNIX for Dummies Questions & Answers

analyzing list with street addresses

Hi List, Could someone please point me into the right direction with the following: I have a file containing a list of street addresses. I need to sort all the street addresses with the same number to a new file containing the street name and corresponding number. So: Strawinskylaan... (3 Replies)
Discussion started by: M474746
3 Replies

6. UNIX for Dummies Questions & Answers

Difference between Mac and IP addresses

If a web search is done on this topic there are many links but no information included in the documents. So my questions are; Why does a NIC card have it's own permanent ID. Why can't it share the host name? An ID is an ID. Why does a computer need two ways to ID it. If the network... (3 Replies)
Discussion started by: theKbStockpiler
3 Replies

7. Shell Programming and Scripting

Formatting list of IP addresses into a grep command

Hi I have an input file with a list of random IP addresses, each on a new line. Below is just an example as I omitted the real IP addresses for obvious reasons. Input: random_ip.txt 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1... (7 Replies)
Discussion started by: lewk
7 Replies

8. UNIX for Dummies Questions & Answers

List Contacted Web Addresses?

Greetings. I'm in the process of tracking down an issue with Firefox, and need some way of gathering the actual web addresses which are connected to from localhost. The specific problem centers around the determination/capture of the exact generated app.update.url address formed by the... (2 Replies)
Discussion started by: LinQ
2 Replies

9. Shell Programming and Scripting

Don't see my mac addresses of my devices

I have a problem with a script , i want to see my devices there are up in my network. I want as output the ip addresses of the devices and also the mac address but I only had the ip addresses #!/bin/bash while ] do -mac) Extension=5 shift mac=$1 shift ;; esac... (1 Reply)
Discussion started by: Roggy
1 Replies

10. Shell Programming and Scripting

Script getting IP's and MAC addresses

Hy over there, Lets make it simple :) Using a bash script, how to grep only the ip address and the mac address and put them in a file:. for example from the dhcp.conf file we got such things: The script will end up with two columns IP's and MAC adresses as it is showed below: ... (9 Replies)
Discussion started by: hermouche
9 Replies
MAC_SET(3)						   BSD Library Functions Manual 						MAC_SET(3)

NAME
mac_set_file, mac_set_fd, mac_set_proc -- set the MAC label for a file or process LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/mac.h> int mac_set_file(const char *path, mac_t label); int mac_set_link(const char *path, mac_t label); int mac_set_fd(int fd, mac_t label); int mac_set_proc(mac_t label); DESCRIPTION
The mac_set_file() and mac_set_fd() functions associate a MAC label specified by label to the file referenced to by path_p, or to the file descriptor fd, respectively. Note that when a file descriptor references a socket, label operations on the file descriptor act on the socket, not on the file that may have been used as a rendezvous when binding the socket. The mac_set_link() function is the same as mac_set_file(), except that it does not follow symlinks. The mac_set_proc() function associates the MAC label specified by label to the calling process. A process is allowed to set a label for a file only if it has MAC write access to the file, and its effective user ID is equal to the owner of the file, or has appropriate privileges. RETURN VALUES
The mac_set_fd(), mac_set_file(), mac_set_link(), and mac_set_proc() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
[EACCES] MAC write access to the file is denied. [EBADF] The fd argument is not a valid file descriptor. [EINVAL] The label argument is not a valid MAC label, or the object referenced by fd is not appropriate for label operations. [EOPNOTSUPP] Setting MAC labels is not supported by the file referenced by fd. [EPERM] The calling process had insufficient privilege to change the MAC label. [EROFS] File system for the object being modified is read only. [ENAMETOOLONG] The length of the pathname in path_p exceeds PATH_MAX, or a component of the pathname is longer than NAME_MAX. [ENOENT] The file referenced by path_p does not exist. [ENOTDIR] A component of the pathname referenced by path_p is not a directory. SEE ALSO
mac(3), mac_free(3), mac_get(3), mac_is_present(3), mac_prepare(3), mac_text(3), posix1e(3), mac(4), mac(9) HISTORY
Support for Mandatory Access Control was introduced in FreeBSD 5.0 as part of the TrustedBSD Project. BSD
January 14, 2003 BSD
All times are GMT -4. The time now is 08:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy