Sponsored Content
Full Discussion: Naming convention script
Top Forums Shell Programming and Scripting Naming convention script Post 302402422 by nj78 on Tuesday 9th of March 2010 08:53:56 PM
Old 03-09-2010
Hi, quick and dirty to get you started, output is:

sh money 10.192.0.0
IP is 10.192.0.0
the second octet is 192


code:


#!/bin/bash


IP=$1;
OCT2=$(echo $1 |awk -F . '{print $2}')

echo "IP is $IP"

echo "the second octet is $OCT2"


You can then build logic (such as a case statement) and take action based upon what is reported for the second number as you put it, or just use a few few if statements if there is not that many different choices.
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Naming convention for Libraries..

Hi All, I need to know standard naming convention for Unix libraries (including all flavours of unix)..As I have gone through some sites and found out The UNIX convention for naming of libraries is lib<name>.so.<major>.<minor>.<revision> so is it statndard . also does it change... (0 Replies)
Discussion started by: rkshukla14
0 Replies

2. Shell Programming and Scripting

Shell Script for file naming

Hi All, I am looking for a Unix shell script for file naming such that the file names itself as KARAN0001. The 4 digit sequence number must start at 0001 and end at 9999. After 9999 is reached, the number must reset to 0001. Can anyone please help me with that. Thanks & Regards ... (2 Replies)
Discussion started by: karansachdeva
2 Replies

3. Hardware

Motherboards naming convention

For the selection of motherboards, is there any naming convention in the type numbers? There is usually a brand name and sometimes a version name, but more essential details like form factor, SATA speed and maximum amount of RAM is never given. Is there a reason for that? Is there any background... (2 Replies)
Discussion started by: figaro
2 Replies

4. Shell Programming and Scripting

naming columns

i have a file staff.txt with contents tom|25|New York sims|40|London neyo|18|Moscow i want to label the column at the top, my output should be Names|age|city of birth tom|25|New York sims|40|London neyo|18|Moscow (4 Replies)
Discussion started by: blackzinga80
4 Replies

5. Shell Programming and Scripting

Concatenate files to one file with naming convention

Hi , i have below files in wrk folder. file names are 1102090001.CLT 1102090003.CLT 1102100019.CLT 1102100020.CLT the above files are concatenate to one file but that concatenate file name must be same naming convention. (date +%y%m%d)and 0001 count. example : concatenate file... (9 Replies)
Discussion started by: krbala1985
9 Replies

6. Fedora

Basic question regarding rpm naming convention.

Hi Guys, Where would i find the list of distribution codes. For example. samba-32bit-3.4.2 -1.1.3.1.x8664.rpm In above rpm file it is indicated that its release is 1.1.3.1 . The rpm is meant to be run for opensuse. Where would i get the linking of release number and distribution. ... (2 Replies)
Discussion started by: pinga123
2 Replies

7. UNIX for Dummies Questions & Answers

Check file name against convention

I need this script to check if the first 3 letters of the file name are capital. find . -type f -name *001.dpx -exec find {} ! -name ???_???_???_v??.??????.dpx \; >> ./Bad_FileNames.txt Currently it finds the first frame of the sequence and tests that against the naming convention. It works... (6 Replies)
Discussion started by: scribling
6 Replies

8. Red Hat

File System Naming Convention

Hi, I am installing a new RHEL 5 application server containing JBOSS along with other specific 3rd party applications. I know that this usually gets installed in /opt but I was thinking of installing these on a new separtate lv / file system instead. i.e. /<my_new_FS_name> rather than... (6 Replies)
Discussion started by: Duffs22
6 Replies

9. Shell Programming and Scripting

file naming in a script

#!/bin/bash while read inputline do what="$inputline" echo $what; if ; then exit fi $reextend $what $print ls -a done this is my code i am trying to change all of the file types of a certain directory to another file type but im not all the way there can someone help please (3 Replies)
Discussion started by: domdom110
3 Replies

10. Shell Programming and Scripting

Change the naming convention of the output file

Hi Currently we have nmon running on our Red hat Linux server. The ouput file is now coming with the naming convention as "servername_160321_0010.nmon". The output file naming convention has to be changed as "nmon_servername_daily_2016.03.21_00.00.00" How can we do it ? Any suggestions... (10 Replies)
Discussion started by: newtoaixos
10 Replies
TUNCTL(8)						      System Manager's Manual							 TUNCTL(8)

NAME
tunctl -- create and manage persistent TUN/TAP interfaces SYNOPSIS
tunctl [-f tun-clone-device] [-u owner] [-t device-name] tunctl [-f tun-clone-device] -d device-name DESCRIPTION
This manual page documents briefly the tunctl command. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. Instead, it has documentation in HTML format; see below. tunctl allows the host sysadmin to preconfigure a TUN/TAP device for use by a particular user. That user may open and use the device, but may not change any aspects of the host side of the interface. USAGE
To create an interface for use by a particular user, invoke tunctl without the -d option: # tunctl -u someuser Set 'tap0' persistent and owned by 'someuser' Then, configure the interface as normal: # ifconfig tap0 192.168.0.254 up # route add -host 192.168.0.253 dev tap0 # bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp' # arp -Ds 192.168.0.253 eth0 pub To delete the interface, use the -d option: # tunctl -d tap0 Set 'tap0' nonpersistent SEE ALSO
The UserModeLinux-HOWTO (link to URL http://user-mode-linux.sourceforge.net/UserModeLinux-HOWTO.html) AUTHOR
tunctl was written by Jeff Dike jdike@karaya.com This manual page was written by Matt Zimmerman mdz@debian.org for the Debian GNU/Linux system, based on examples from Jeff Dike. TUNCTL(8)
All times are GMT -4. The time now is 07:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy