Search Results

Search: Posts Made By: insania
4,540
Posted By insania
PCRE negative lookahead
I have read many tutorials and cannot get this to work. I need to use pcre (because that is what the library in the software we are using uses) and pcregrep everything except /home from the...
2,083
Posted By insania
Perl - update output
I need help with the following code. It does what i want it to, but since I clear the screen and do not update it when i finally ^C my scroll back buffer is filled with garbage. Term::Cap might not...
6,764
Posted By insania
User perl to get memory installed in a machine
I currently have a statistics gathering script i run on my Linux servers. One of the stat i gather is total memory in the machine. The script is all perl with the exception of gathering the memory...
2,378
Posted By insania
Sweet, the following code worked: if...
Sweet, the following code worked:

if (($model eq "N\\A\n") && ($kernel =~ m/xen/)) {
$model = "Virtual Machine\n";
}

Had to add the \n on the "N\\A" variable because that is how it is...
2,378
Posted By insania
perl if elsif statements
I have having problems with an IF statement in my perl script:

if ($model eq "N\\A") {}
elsif ($kernel =~ m/xen/) {
$model = ("Virtual Machine\n")};


What i am trying to accomplish is...
2,107
Posted By insania
HPUX to Linux awk conversion
I have the following script to edit ^'s and newlines out of files to be entered into a database. This script has been around since the dawn of time (way before me).

#!/bin/bash

# Remove all ^...
11,002
Posted By insania
Sed Replace a repeating character
I have a text file and every line ends in


|^
|^^
|^^^
|^^^^


I need to use sed to make all lines end it

|^

regardless of the amount of carrots.

The code i was using is:

cat...
6,685
Posted By insania
This returns me the actual model of the machine. ...
This returns me the actual model of the machine. In this case

ProLiant BL25p G1

Which is what management wants. I was just curious if there was a perl way to do the grep and awk (I know i...
6,685
Posted By insania
Using perl grep and awk
I have a script to get server information i wrote in perl because i would like to learn it (and I use it for work). It works great, however i would like to know if there is a good way to reduce the...
4,101
Posted By insania
Perl script to move files not in use
I need to write a script to move files only when they are not in use. I have a rudementry bash script for Linux but i need a perl script so it will work on Linux and hpux. Oracle writes files to a...
6,541
Posted By insania
du alternative in perl
I have a perl script that just does a `du -sk -x` and formats it to look groovy ( the argument can be a directory but usually is like /usr/local/* )

#!/usr/bin/perl

use strict;
use warnings;
...
23,941
Posted By insania
Perl Search and replace entire line
I have a perl function in my script that needs to replace an entire line in a file

sub changestate {
my $base = ();
my @base = ();

open(BASE, $file) || die("Could not open file!");
...
9,200
Posted By insania
5 years old and this post is still helpful, thank...
5 years old and this post is still helpful, thank you unix.com.
3,511
Posted By insania
Perfect
The paste command worked great and did just what I was looking for. I appreciate the help.

Sean
3,511
Posted By insania
change list to comma seperated items
I have a list of servers in a file called serverlist like this

server1
server2
server3

i need to have them (with no trailing comma, the program does not like that)

server1,server2,server3...
3,221
Posted By insania
Javascript Replace Globally
I have a bit of javascript


function hasSpaces(name)
{
if(name.search(/^\s*/) != -1){
alert(name);
name.replace((/^\s*/,...
1,270
Posted By insania
That command worked great, i have never used the...
That command worked great, i have never used the uniq command before but it was just what i was looking for thank you.
1,270
Posted By insania
Sort differences
I have a file that contains

/home
/opt
/stand
/var
/usr
/tmp
/opt
/home

I need to print the lines that are unique so the output would be

/stand
/var
/usr
/tmp

and omit any...
3,236
Posted By insania
That worked great thank you
That worked great thank you
3,236
Posted By insania
Hex Conversion
I need to have my scripts import volume groups and mknod devices files. I have most of the script working but the device file needs to be in the format 0x??0000 (where the question marks are my HEX...
14,820
Posted By insania
that worked perfectly thank you
that worked perfectly thank you
14,820
Posted By insania
AWK greater than 200
I need to grep out usernames with UID's greater than 200 out of the /etc/passwd file for a server migration. It is the third field however I am not sure to to accomplish this. I tried to search the...
5,199
Posted By insania
Run remote EOF command
I have the command

cat - << _EOF | ed /home/fred/test >/dev/null 2>&1
2 s#u_pwd=[^:]*:#u_pwd=${Password}:#
3,$ s/u_succhg#[^:]*:/u_succhg#${Date}:/
w
q...
6,175
Posted By insania
Sweet all of them work great. I went with...
Sweet all of them work great. I went with aigles's code because it was the shortest but now I need to look into python. Thanks a lot guys.
6,175
Posted By insania
Need to add colons
Hey guys i need to take the MAC address in the format of

0x00255T08D433

and convert it to

00:25:5T:08:D4:33 (it goes :08: D4:33 with no space the forum is making it a big smiley)

for a...
Showing results 1 to 25 of 31

 

Featured Tech Videos

All times are GMT -4. The time now is 01:45 AM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy