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]
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.
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.
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
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,
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.
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?
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:
[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.
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.
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...?
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.
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?
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.
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?
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
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..
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:
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.
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.
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'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?
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?