Sponsored Content
Top Forums Shell Programming and Scripting Need help in finding and replacing port numbers. Post 302241972 by rubin on Tuesday 30th of September 2008 08:04:34 PM
Old 09-30-2008
Assuming the same file format as above:

Code:
for file in files_list*
 do
  awk -F'"' '/port="[0-9]+"/{OFS=FS; $(NF-1)=$(NF-1)+200; print; next}1'   "$file" > "$file".new
 done


Last edited by rubin; 09-30-2008 at 09:05 PM.. Reason: quoting variables
 

10 More Discussions You Might Find Interesting

1. IP Networking

finding port numbers

hither! whatz the command to find which process is using a specific port number? for example, port 8082? (3 Replies)
Discussion started by: darkcastle
3 Replies

2. UNIX for Dummies Questions & Answers

shellscript for finding and replacing in DG-UNIX

Newby here..... Is there any way of doing a find & replace within a huge file other than using something like : " vi - FileForReplacing < /u1/excel/consultants " contents of consultants file looks like :1,$s/0000031/CON/g :1,$s/0001032/JONES/g :1,$s/0001355/SMITH/g... (3 Replies)
Discussion started by: Gerry405
3 Replies

3. Shell Programming and Scripting

replacing numbers greater than 0 with 1

I have some ASCII files containing numerous numbers. What I'd like to do is replace all numbers greater than 0 with 1. Examples of the numbers include: - 000011 and 000042 Thanks (4 Replies)
Discussion started by: vrms
4 Replies

4. Solaris

Finding port number !!

Hi all , I want know the port no on which a particular application is running. How to find that? Thanks in anticipation (11 Replies)
Discussion started by: kumarmani
11 Replies

5. Shell Programming and Scripting

Replacing Port number Using Sed

Hi Im trying to replace http port value.However for some reason its not working.Can you guys take a look and hit me with suggestions please.Your help is much appreciated. echo "Enter Value" read ans sed -i "s/http-port = 80 /http-port = $ans/g" demo Note:demo is the filename ... (6 Replies)
Discussion started by: coolkid
6 Replies

6. Shell Programming and Scripting

Replacing numbers in bash scripts

Hi, I have lines in some files that look exactly as below, and the line numbers they occur in are always the same. (Lines 136-139) W 0.00000000 0.00000000 2.00000000 W 0.50000000 0.50000000 2.50000000 W 0.00000000 0.00000000 3.00000000 W 0.50000000 0.50000000 3.50000000 I'd like to... (0 Replies)
Discussion started by: bluesmodular
0 Replies

7. Shell Programming and Scripting

Finding and replacing links

Hi, I would like to do a scripting for finding the links based on the name I have and replace the links with the new name. General find command lists everything for that links ( means all the sub-sirs and all the files), i need only the main link and replace. Can you anyone give me some... (1 Reply)
Discussion started by: rrb2009
1 Replies

8. Shell Programming and Scripting

Mapping and replacing numbers in two files

hi i have two files one of the form 1 2 2 45 3 56 4 98 5 6598 6 98 7 10 8 0 9 15 10 56 This file's significance is that it maps the number in first column to that of the number in second column The other file is of the form 1 2 (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

9. Shell Programming and Scripting

SFTP - using port numbers?

Hi Guys, I saw this line of code in a script sftp username@hostname#2200 get file and the script never asked for password. Can you please explain on this?:confused: (9 Replies)
Discussion started by: PikK45
9 Replies

10. Shell Programming and Scripting

Replacing a character between two numbers

Hi, I need to replace a character between two numbers (specifically a - to a _). The problem is that they can be *any* numbers. So, I need a one liner to turn a file like this: 1-2 3-4 55-66 4323-12312893 into the following 1_2 3_4 55_66 4323_12312893 Any help would be appreciated! (5 Replies)
Discussion started by: mikey11415
5 Replies
IRSEND(1)								FSF								 IRSEND(1)

NAME
irsend - basic LIRC program to send infra-red commands SYNOPSIS
irsend [options] DIRECTIVE REMOTE CODE [CODE...] DESCRIPTION
Asks the lircd daemon to send one or more CIR (Consumer Infra-Red) commands. This is intended for remote control of electronic devices such as TV boxes, HiFi sets, etc. DIRECTIVE can be: SEND_ONCE - send CODE [CODE ...] once SEND_START - start repeating CODE SEND_STOP - stop repeating CODE LIST - list configured remote items SET_TRANSMITTERS - set transmitters NUM [NUM ...] SIMULATE - simulate IR event REMOTE is the name of a remote, as described in the lircd configuration file. CODE is the name of a remote control key of REMOTE, as it appears in the lircd configuration file. NUM is the transmitter number of the hardware device. For the LIST DIRECTIVE, REMOTE and/or CODE can be empty: LIST "" "" - list all configured remote names LIST REMOTE "" - list all codes of REMOTE LIST REMOTE CODE - list only CODE of REMOTE The SIMULATE command only works if it has been explicitly enabled in lircd. -h --help display usage summary -v --version display version -d --device use given lircd socket [/var/run/lirc/lircd] -a --address=host[:port] connect to lircd at this address -# --count=n send command n times EXAMPLES
irsend LIST DenonTuner "" irsend SEND_ONCE DenonTuner PROG-SCAN irsend SEND_ONCE OnkyoAmpli VOL-UP VOL-UP VOL-UP VOL-UP irsend SEND_START OnkyoAmpli VOL-DOWN ; sleep 3 irsend SEND_STOP OnkyoAmpli VOL-DOWN irsend SET_TRANSMITTERS 1 irsend SET_TRANSMITTERS 1 3 4 irsend SIMULATE "0000000000000476 00 OK TECHNISAT_ST3004S" FILES
/etc/lirc/lircd.conf Default lircd configuration file. It should contain all the remotes, their infra-red codes and the corresponding timing and wave- form details. DIAGNOSTICS
If lircd is not running (or /var/run/lirc/lircd lacks write permissions) irsend aborts with the following diagnostics: "irsend: could not connect to socket" "irsend: Connection refused" (or "Permission denied"). SEE ALSO
The documentation for lirc is maintained as html pages. They are located under html/ in the documentation directory. lircd(8), mode2(1), smode2(1), xmode2(1), irrecord(1), irw(1), http://www.lirc.org. irsend 0.8.7pre1 May 2010 IRSEND(1)
All times are GMT -4. The time now is 01:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy