02-13-2012
script puts;; I need just ;
Hello Folks,
I must be blind that I cant figure out this perl script why I end up with ;; at the end of the line.
I am not an expert by any means
HTML Code:
#!/usr/bin/perl
use File::Find;
open F,shift or die $!;
my %ip=map/(\S+)\s+(\S+)/,<F>;
close F;
find sub{
if( -f ){
local @ARGV=($_);
local $^I="";
while( <> ){
s/^(option\s+domain-name-servers\s.*)/$1;/ && s/([\w.]*\w)\.?/$ip{$1}||$1/eg;
print;
}
}
},@ARGV
I am doing a search and replace, but after it runs, I get
;;
option domain-name-servers 126.7.3.101, 166.2.100.78
;;
I only need it to look like this
option domain-name-servers 126.7.3.101, 166.2.100.78
;
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am trying to output a set of fields to a file:
set outFile "printHeader.tmp"
set dbFields "REPORT.TIMESTAMP.s,REPORT.CUSTOMER.s,REPORT.CODE.s"
puts $dbFields > $outFile
I receive the following error message:
bad argument "printHeader.tmp": should be "nonewline"
... (2 Replies)
Discussion started by: MrG-San
2 Replies
2. UNIX and Linux Applications
Hello All,
Can someone explain what is meant by "pipe puts" in Oracle??
Thanks (1 Reply)
Discussion started by: nareshprasannar
1 Replies
3. Shell Programming and Scripting
I have
a='123, abc, def, ghi'
var1=`echo $a | awk -F", " '{print RS $1}'`
echo "something: $var1"
which outputs
something
123
how can I tell awk not to put a newline between fields? I want it to output:
something: 123 (4 Replies)
Discussion started by: unclecameron
4 Replies
4. Shell Programming and Scripting
Hi all,
I'm trying to do something that might be basic, but it is not working for me, and I suspect I'm missing something.
I appreciate if you can shed a light or offer an alternative.
In expect script, I'm opening a file i.e:
set file I have a simple proc:
proc a {} { puts "Hello... (3 Replies)
Discussion started by: ydekel
3 Replies
5. Shell Programming and Scripting
There is a same named log file that I have on my 2 different android phones. When I plug it into my computer, it appears in the media folder, For example the first android phone:
/media/F6BA-0AF5/folder/A.log
I want to put that into a variable to be manipulated.... (3 Replies)
Discussion started by: tobenguyen
3 Replies
6. UNIX and Linux Applications
Hello all,
When I type :e in vim and then press TAB, vim suggests filenames in that directory. However, when I do the same in gvim, it instead shows ^I for every TAB press instead of suggesting filenames. Anyone know what's going on here ?
Thanks in advance.
ChandlerAZ
---------- Post... (0 Replies)
Discussion started by: chandleraz
0 Replies
7. Shell Programming and Scripting
I'm pretty new to bash scripts and I'm trying to work through some issues. Would appreciate any suggestions.
I have a list of servers in a text file (I used the FQDN's), I assign the file name to a variable, I then use cat to read the list of file names and echo them to the screen. But when it... (2 Replies)
Discussion started by: westmoreland
2 Replies
8. Shell Programming and Scripting
Hi All,
Sorry for long topic here.
So the drill goes like that, I need a script which gathers different values from different files/locations.
A_CT=`cat a.dat | awk -F'|' '{print $1}' >> report.txt`
B_CT=`cat b.dat | awk -F'|' '{print $3}' >> report.txt`
C_CT=`cat c.dat | awk -F'|'... (4 Replies)
Discussion started by: shivakid
4 Replies
9. What is on Your Mind?
Enjoy...
Watch What Happens If You Try To Divide By Zero On This Mechanical Calculator | IFLScience (0 Replies)
Discussion started by: wisecracker
0 Replies
shells(4) File Formats shells(4)
NAME
shells - shell database
SYNOPSIS
/etc/shells
DESCRIPTION
The shells file contains a list of the shells on the system. Applications use this file to determine whether a shell is valid. See getuser-
shell(3C). For each shell a single line should be present, consisting of the shell's path, relative to root.
A hash mark (#) indicates the beginning of a comment; subsequent characters up to the end of the line are not interpreted by the routines
which search the file. Blank lines are also ignored.
The following default shells are used by utilities: /bin/bash, /bin/csh, /bin/jsh, /bin/ksh, /bin/pfcsh, /bin/pfksh, /bin/pfsh, /bin/sh,
/bin/tcsh, /bin/zsh, /sbin/jsh, /sbin/sh, /usr/bin/bash, /usr/bin/csh, /usr/bin/jsh, /usr/bin/ksh, /usr/bin/pfcsh, /usr/bin/pfksh,
/usr/bin/pfsh, and /usr/bin/sh, /usr/bin/tcsh, /usr/bin/zsh. Note that /etc/shells overrides the default list.
Invalid shells in /etc/shells may cause unexpected behavior (such as being unable to log in by way of ftp(1)).
FILES
/etc/shells lists shells on system
SEE ALSO
vipw(1B), ftpd(1M), sendmail(1M), getusershell(3C), aliases(4)
SunOS 5.10 4 Jun 2001 shells(4)