General :: String Comparison Error "user@host:~/scripts> ./check_BRK1E.sh BIP1284I: Broker 'BRK1E' On Queue"

Jan 31, 2011

Here's my code on SLES v11.

#! /usr/bin/ksh
MQSILIST=$(mqsilist)
RUNNING="BIP1284I: Broker 'BRK1E' on queue manager 'BRK1QME' is running. BIP8071I: Successful command completion."
echo $MQSILIST
if ["$MQSILIST" == "$RUNNING"]; then
echo "Running."
fi

Here's the error I receive. user@host:~/scripts> ./check_BRK1E.sh BIP1284I: Broker 'BRK1E' on queue manager 'BRK1QME' is running. BIP8071I: Successful command completion. ./check_BRK1E.sh[8]: [BIP1284I: Broker 'BRK1E' on queue manager 'BRK1QME' is running. BIP8071I: Successful command completion.: not found [No such file or directory]

View 1 Replies


ADVERTISEMENT

Software :: Awk From End Of String - 3 Position Comparison

Oct 3, 2010

I would like to check if the 3rd character from the end of a string is a d or p using awk and the field seperator would not help for this problem, i.e.

Code:

View 4 Replies View Related

Programming :: Script For Executing A Program And Doing String Comparison

May 6, 2009

I am fairly new to linux still and I'm currently trying to write a shell script (which I have never done) that is supposed to run the xrestop(like top) program. What I want to do is execute the program and check the identifier column to see if a certain program is running. If it is running I want to strip the data from that row of the terminal say every 5 seconds or so and put it in a text file. Is this going to be a complicated thing?

Heres a list of the columns when you run xrestop program res-base Wins GCs Fnts Pxms Misc PxmMem Other Total PID Identifier.

View 9 Replies View Related

Programming :: String Comparison - [: =: Unary Operator Expected?

Nov 23, 2010

I would like to compare the nmlookup result of IP's stored in the file ips with a list of PC names stored in the file pcs.

Code:
for line in `cat "ips"`
do

[code]....

View 2 Replies View Related

Programming :: String Comparison - Get Regular Expression To Work In If / Else Statement?

Jun 29, 2010

how do I get this regular expression to work in an if/else statement? This is just a little script for learning BASH. don't be too harsh.

This script will test if a certain number of files with 1-4 in their filename exist and print their filename. An error message will be printed if not.

#
for i in `ls file[1-9]`
do
if [[ "$i" == *1-4 ]] ; then
echo "This file, $i, ends in a number between 1-4"
else
echo "Error, this file, $i, does not end with a number between 1-4"
fi
done

I get this error. ./file_test.sh: 13: [[: not found

View 2 Replies View Related

General :: What Is Difference Between Power Broker Utility And Sudo Command

Aug 11, 2011

I just wanted to know the difference between Using Sudo mechanism over using Power breaker utilities.

View 4 Replies View Related

General :: Scripts Should Use An Informative User-agent String With Contact Information?

Jun 19, 2010

After installing Slackware 13.1, I find that I am getting the message:scripts should use an informative user-agent string with contact informationwhen I access certain websites. Wiki pages, for example. This happens only with Konqueror. Any ideas as to what I might change to gain access to content,

View 1 Replies View Related

General :: Restrict File Access To The Root User Of One Particular Host?

Aug 12, 2010

If there is a general NFS share in the LAN and for example this share has three files - a, b, c is there any way to restrict file access to the root user of one particular host(falcon) in the same LAN environment while the normal users from the same host(falcon) should be able to access the NFS share & files a, b, c.

View 1 Replies View Related

Programming :: Get Length Of Run Queue And Swap Queue?

Nov 3, 2010

is it possible to get the length or even the items of both queues, the run queue and the swap queue? I've googled a lot but had no luck. Maybe I havn't used the correct search words...

Is there any header and/or code example to use structures or any API to get these information from the kernel or the scheduler?

View 1 Replies View Related

General :: Getting Segmention Fault Error While Searching String In Csv File?

Jan 18, 2011

I am using grep command to search in a particular file whose size is 11 GB and i am getting Segmentation fault error as an output. My command and output is as follows:

Code:

[sdpuser@gnnsdp40 test]$ cat new* | grep 8858406465
Segmentation fault

My linux version is as follows:

Code:

[sdpuser@gnnsdp40 test]$ uname -a Linux gnnsdp40 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

how i can parse the complete file for searching string. I have also used split command of linux which splits the file of 11 GB to 11 files of 1 GB each respectively. But still getting the same "Segmentation fault" error while using grep.

View 9 Replies View Related

Programming :: Copy String A To String B And Change String B With Toupper() And Count The Chars?

Oct 22, 2010

copy string a to string b and change string b with toupper() and count the chars

View 3 Replies View Related

General :: Replace String With Empty String Of Dir Path ?

Apr 2, 2011

I want to replace a string of directory path in a string to empty:

Code:

But this doesnt seem to give me the desired thing:

Code:

This gives the desired outcome, but its specific, i need a variable in the sed not a string. And if I replace STRING="/mnt/sda1/record/$dd/" then I cant use it for something else, cause its has all the weird backslashes now.

View 3 Replies View Related

General :: I/O Error - No Route To Host ?

Jan 8, 2011

I am using fedora 14..i wanna create webservice in fedora 14...i am able to create sevice in server machine...but the client not able to get service from the server.it shows an error an i/o error has occured.no route to host.....we checked the ip address and port...i am able to ping the server...its connecting ...but it shows this error...?

View 1 Replies View Related

Server :: Host Unknown Error:Sendmail / Stat=Host Unknown (Name Server: Def-fgh.com.: Host Not Found)?

Sep 8, 2009

Many of mails sent from my mail server that are in Queue;The main reason is deffered by domains like yahoo,aol,etc.but there is one more error that i keep getting and that is Host Unknown,Below is an example from mail log,The catch is,test mail sent on the same email id sent from my personal mail from the same server i.e. url was deliveredHowever,another mail containing client information sent from customercare@mycompanysdomain ended up in queue.

There are more examples of the same,around 20 domain have the same problem.

Sep 7 14:33:46 server2 sendmail[24591]: n8793jiC024589: to=<abc@xyz.fi>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=163672, relay=xyz.fi., dsn=5.1.2, stat=Host unknown (Name server: xyz.fi.: host not found)

Sep 7 22:09:42 server2 sendmail[6407]: n87Gdffa006403: to=<abc@def-fgh.com>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=152474, relay=def-fgh.com., dsn=5.1.2, stat=Host unknown (Name server: def-fgh.com.: host not found)

View 2 Replies View Related

General :: Extract A String Within A String Using A Pattern?

Nov 4, 2010

i have a file name using the following pattern:

PREFIX: AR
SOURCE: LEGACY
DATETIME: YYYYMMDD_HH24MISS
SUFFIX: .txt

sample filename:AR_LEGACY_20101104_105500.txti want to extract the source which is LEGACY in this case. how do i do this using shell?

View 1 Replies View Related

General :: CPU Comparison - Trusted Source That Compares Performance?

Dec 5, 2010

How to compare CPUs? Is there a trusted source that compares cpu performance?

View 4 Replies View Related

General :: Tool Or Set Of Scripts To Capture Information And Do System Level Comparison?

Jun 12, 2011

If I have three (3) servers that are suppoed to be configured exactly alike, is there a tool or set of scripts that I can use to capture the information and do a system level comparison?

View 1 Replies View Related

Debian :: Modify Configuration To Enable OpenVPN To Act As Tunnel Broker

Feb 18, 2011

I currently run openVPN on my Debian box that provides secure ipv4 routing from my laptop to my VPS in a different country (and from there the internet via this box). This works fine. However, id like to sort out ipv6 through this VPN as well as IPV4 and not overly sure how to do it. The remote server itself has native ipv6 configured on device eth0 and it works (ping6, traceroutes all fine,incoming to web servers etc) nicely on dual stack.

How would i go about modifying the config (both client and server if needed) to enable openVPN to act as a tunnel broker to enable the laptop to use the ipv6 through the server as well as the old v4? (the internet connection laptop end will not/does not have native ipv6 from the ISP. Currently im using he-net tunnel broker but id like to run myself through my existing openVPN). VPN config details: Its using UDP, port 1194, creates a TUN interface, redirect-gateway etc and the rest is normal config. Edit:- if it matters the clients are all running windows so i cant use sh scripts to set up stuff client end.

View 1 Replies View Related

Networking :: Using A Public-Facing SSH Server To Broker A Connection Between Two Clients?

Feb 22, 2010

I'm sure this is possible... I'm just not sure how. Yet! I have three machines. One is at home behind my firewall and has a dynamic IP. That's fine as I don't really want to open any ports on my home firewall. The second is at work sitting behind the firewall there- and I'm not even going to ask for approval to NAT an IP to my PC at work :-).

The third is in a data center far away. I only have a shell account on this server but other than that shell account not being root, I can do most anything I like with that account. What I would like to do is SSH to this server simultaneously from my home and work PCs and, via this third machine, make them talk.

This is pure geekery so it doesn't matter what they say to each other; I just want to make them talk. Maybe one uploads a file and the other just pulls down that file. Maybe one opens a FIFO on the remote server and starts writing to it while the other starts snarfing that data. In fact, I like this latter idea best, I think. How would you do it? What scripts (fired by cron if need be since I'm ostensibly away from at least one of the PCs at any given time) would you use?

View 1 Replies View Related

Programming :: Check If A String Entered By User Starts With A Particular Pattern Or Not?

Feb 4, 2010

How do i check if a string entered by a user starts with a particular pattern or not?

View 3 Replies View Related

General :: Awk Gsub() Command - String (column) Manipulation - Replace The Value Of The $1 Column In The Awk Print String?

Mar 7, 2010

i use this script to get the time and date of back and fourth transactions for a particular execution id. I use a substr command on the 5th column to to cut the milli seconds off the time value. - otherwise the times would look like 08:30:04.235

grep <executionID> <auditfile> | awk '{ print $1, $2, $3, $4, substr($5,1,8}
FIX -> Mon 3/1/2010 08:30:04
FIX <- Mon 3/1/2010 08:32:36
FIX <- Mon 3/1/2010 08:35:08

[code].....

anyhow - i append two sed commands to further clarify the direction of the message.

awk '{ print $1, $2, $3, $4, substr($5,1,8} | sed -e 's/->/ ->IN/g' | sed -e 's/<-/<-OUT/g'
FIX -> IN Mon 3/1/2010 08:30:04
FIX <- OUT Mon 3/1/2010 08:32:36

[code]....

I tried using an awk gsub () command within the string instead of the two seds, but it did not work:

awk '{ print gsub(/<regex>/, <replace with>,$1), $2, $3, $4, substr($5,1,8}

the sed works ok, but it would be cooler to make the replacement within the awk command:

gsub(/->/,-> IN, $1)

Is there a way where i could replace the value of the $1 column in the awk print string?

View 1 Replies View Related

Software :: Check A String With Actual User Passwd (ie Password In /etc/shadow)?

Sep 24, 2009

I am trying to write a remote access module. Is there any function in linux where I can give string (password entered by user) and compare it with the actual user password stored in /etc/shadow. Since the password is stored encrypted in /etc/shadow I cannot parse and compare. So I want some method to compare if my user entered the correct password..Is there any function for that..

View 6 Replies View Related

General :: String Replace In Filenames - Files Already Contain The String "Soundtrack"

Jun 11, 2011

Moving right along, I have a folder of MP3 files containing various Movie sound tracks and scores. I'm using Audio Tag Tool to tag all the files at once with an "Artist" of "Soundtrack", and to inherit the "Title" tag from the file name. After that, I will rename all the files (Using Audio Tag Tool -- awesome program, btw) with the format "<Artist> - <Title>.mp3"

The problem, is many of my files already contain the string "Soundtrack", which would be redundant. I happen to be a perfectionist, so I'm unable to ignore it and move on. Hence my question to you fine folk: I want to delete all instances of "soundtrack" (-i case irrelevant) in the filenames before I go through the above steps. But, its not quite that simple. This is a sample of some of the file names:

[Code]....

View 3 Replies View Related

General :: Transfer Large Number Of Files Host To Host

Oct 20, 2010

I have two servers, one has an empty / and the other has a subdirectory with a large number (4 gig) with many, many files. I need a way to transfer the files en masse from the server with the large number of files to the one that is essentially blank.I don't have space on the used host to simply gzip all the files. I've googled this and see that there may be some combination of tar and/or gzip that will let me do this with some sort of redirection.

I really need and example line of how this can be accomplished. If my explanation seems rather sparse, I can supply more details.

View 3 Replies View Related

Security :: Restrict A User On SSH From Everywhere Except One Host?

May 3, 2011

I want to restrict user for SSH Logon, but able to use SFTP.

Also, i like to know how to restrict a user on SSH from everywhere except one host.

View 5 Replies View Related

Fedora :: Error "Printer Queue Setup Failed - Restart CUPS And Try Again"

Jan 18, 2010

I'm having a problem trying to set up my HP OfficeJet 6310 printer with Fedora 12. This is with a clean install, SELinux disabled and Seems to be some issue specific to Fedora, as I've used the same setup with the same hardware without problems in other distributions. I have installed all the HP files I believe should be installed. Anyway, my printer is on my wireless network. I can see the printer on the network, as is the case with my other computers.

I followed the standard setup I use with any other distro....open a terminal and enter "hp-setup." The HP Setup utility opens and I go through the standard procedure of choosing /Network/Ethernet" as my means of connecting. Moving on, the HP OfficeJet 6310 is found without a problem. When I attempt to "Add Printer," however, I am then getting an error. The error shows, "Printer Queue Setup Failed. Restart CUPS and try again." Looking at [URL], I get to CUPS but can get nothing there so far as a printer goes.

View 14 Replies View Related

General :: Ssh: Connect To Host 192.168.100.xxx Port 22: No Route To Host

Mar 9, 2011

I'm trying to ssh from my laptop to my desktop (both fedora 14) over a local network. I can ping my desktop and get responses, but if I ssh to it, I receive

ssh: connect to host 192.168.100.xxx port 22: No route to host

I can ssh from the desktop to itself.

View 4 Replies View Related

General :: Get The Ip Address Of Host Using Of Host And Nslookup Command?

Oct 20, 2010

HOW TO GET THE IP ADDRESS OF HOST IN LINUX WITH USING OF HOST AND NSLOOKUP COMMAND and after getting the ip address how to assign it in the variable

View 4 Replies View Related

General :: Possible To Queue An Item In Postfix By?

Aug 22, 2011

I'm wondering if it's possible to create mail packages and put them into the postfix queue simply by writing files to the hard drive.Currently I have a script which uses a socket connection to dump the data in, but if I could write it directly to the hard drive this would speed things up considerably. Is this possible?

View 3 Replies View Related

General :: Setup The Printing Without A Local Queue?

Jan 10, 2011

I have a non-root account on a shared server, on which the system administrators do not support printing because of past experience with stalled and runaway jobs. For the same reason, they do not allow installation of a user-land spooler. How can I set up printing without a local queue?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved