Programming :: Check If $var Is Not Start With 0
May 25, 2010I need to check if $var is not start with 0
Code:
read var
if [ $var IS NOT START WITH 0 (or something like 006077) ];then echo 'Good'
I need to check if $var is not start with 0
Code:
read var
if [ $var IS NOT START WITH 0 (or something like 006077) ];then echo 'Good'
I have startup scriptsI want to test themI need a script to do the followingstart restart stop for 100 times (or i can set how many cycle)
View 1 Replies View RelatedI want to put check menu & check list in utility dialog.i dont know how i do this
View 1 Replies View RelatedWhen my system starts this command is executed by a script /usr/sbin/apache2 -k start...How can I find which one start it? I check in rc2.d/ dir in the apache script but didn't found anything similar. Where else should I look?
View 7 Replies View RelatedKDE update a number of components in tonights update. When I have gotten this error the past I could simply delete the .kde folder in my home directory and KDE would rebuild one and start. Doesn't work this time.Am I missing something or has something failed to download and install properly
View 1 Replies View RelatedSo I closed out X with ctrl+alt+backspace, and when I did startx it showed the Nvidia splash screen like usual, then shows for just a second that loading splash screen that KDE does. Then a little box pops into the top left corner that says "Could not start kdeinit4. Please check installation." I hit okay on the box, it takes me back to the terminal. I try again, same result. I reboot. Same result. So I use xwmconfig to change to enlightenment, which boots up fine. So I ctrl+alt+backspace out and retry KDE again, with the same problem.
This is the first time I've closed out KDE in over a week, so I guess its possible that anything I've done over that time may have somehow broken it. I hadn't noticed any problems til now. The only reason I did it this time was because I'd changed the KDE plasma theme and I wanted to watch the new one boot up. I'm typing on the same computer and the same Slackware installation right now, just running E instead of KDE.
When I start the computer I receive the message that the drive that contains the /home partition has an error. If I press "F" the screen says that the drive is no ready, that I can wait, cancel or manually recovery. If I wait, in about 1 minute, the system starts normally. If I press "M" to repair manually, then I press fsck to repair the disk and apparently repairs the disk. But everytime I start (power on) the computer, Ubuntu always checks the disk and gives a dialog where I can: press F to attempt to fix the errors, I to ignore, S to skip mounting or M for manual recovery
View 1 Replies View RelatedSuddenly today during the start up the pc stopped to respond while doing a file system check...
I switch it off, restarted and everything seemed to be fine, i got the desktop without troubles.
Then i tried to boot from the live Key and run a fsck but it didn't work, i got some error like:
superblock could not be read....and at the end it says to run e2fsck
I did it and i got the same error...
So i restarted ubuntu and i decided to try:
And i got a blue screen where i selected the first option (something alike restart in normal way)
At the next restart i finally got the checking and it was fine! why i can't run fsck or e2fsck from live key
unclean shutdowns/reboots. Whenever I boot/restart, I notice the message "/dev/hdb1 (and hdb2) was not cleanly unmounted, check forced." Then fsck(?) scans them without errors, and everything continues normally. FWIW, hdb1 @ hdb2 are ext2, /boot & /tmp respectively, whereas all other partitions are ext3. Could that (ext2) be why? I checked halt, reboot, umountfs, umountnfs.sh, and umountroot in /etc/init.d, and nothing jumped out at me, though I'm not exactly sure what I'm looking at/for.
View 8 Replies View RelatedI am using Sphinx search on my webserver and it quits after a certain amount of time leaving my search page broken.Here is a bash script that I want to run every 10mins via cron:
Code:
#!/bin/bash
if pgrep searchd | grep "[0-9]"
[code]...
I'm not able to successfully start a KDE session(SLAX), check out the error, Code: xauth: creating new authority file /root/.serverauth.7378
X.Org X Server 1.4.2
Release Date: 11 June 2008
X Protocol Version 11, Revision 0
[code]....
<edit>never mind dump the ;'s and it all works fine</edit> I'm trying to write a bash script that will check if XMBC is running if it is then do nothing else start it then do some other things.This is the start
Code:
#!/bin/bash
DISPLAY=:0.0
[code]....
I have an Ubuntu server in which a file is dumped every hour and a new file for the next hour and the process continues. If there is any problem due to which the creation of file stops then empty files are created every minute till the process is killed & started again. I need help to make a shell script to check if the empty files are being created and then kill the process and start it again.It would be a great help if anyone can help me regarding this.
View 9 Replies View Relatedsql statement. I am trying to check if there is such a value in the database.
Code:
string NewMovie = "ww";
string queryText ;
queryText = "Select * from movie_info WHERE movie_title = '"+ NewTitle +"'";
MYSQL *conn;
conn=mysql_init(NULL);
mysql_real_connect(conn,host,username,password,database,0,NULL,0);
[Code]......
return 0; The problem i am facing is how do i check if the value is found. I read up and found that a query will return a value of TRUE if the query is a success and a FAIL if there is an error. How do i call these values and then based the check on it?
I have written a tiny script for kernel compilation, which call menuconfig and then compile the kernel. It is working fine. Now I like to test my environment and if it is shell menuconfig will be called and if X then xconfig will be called. How can I check the environment then?
View 7 Replies View RelatedI need to find if, in a folder any directories exist, except a certain one named "mes croquis".What I am trying to say, is that the re already is a directory named "my croquis", which I have to ignore. IF any other directory appears, I have to archive them.I got everything so far, except the starting condition.In other terms , I am lookign for something like this:
IF anyDir EXIST AND name != "mes croquis"
do something
else
[code]....
I've created (as a homework) to create as many folders as told but I still need to check if the variable is a number or not :
Code: #!/bin/sh
echo "Veuillez saisir un nombre"; read nmbr
nmbrf=$nmbr
while [ $nmbrf -gt 0 ]
do mkdir -p "foo$nmbrf"
nmbrf=`expr $nmbrf - 1`
echo "$nmbrf"
how do I check that nmbr is a number or something else?
I have a file with one line. I want to check whether the first character is TAB or space, how can i do this.? using "cut" wont as it "bypasses the tab and space characters"
View 3 Replies View Relatedhave an application where from time to time I need to check the db for some value and run some functions to do some checks. is the best option do it as php daemon or cron job?Whatworried of cron job is the overalapping.
View 9 Replies View Relatedscript that will check if my log file is a certain size? EX: I want to limit the size of my rsync log to say 5MB, if that's true I would move it and create a new one.
View 4 Replies View RelatedIs it possible to check if a pointer is deleted in C++ (using GDB)? For example:
Code:
a = new Thing();
b = a;
delete a;
// If all I have is the variable "b", how can I tell if it was deleted?
We have 7 webservers running in a cluster, and I have zenoss running which does monitor space, network, even performance, but I would like a nice small webpage that I could break into just a few rows of a table. I would like to be able to simple do a reload every 30/60 seconds, and just have the following;row1: server load, memory userow2: server load, memory useBefore the row, if the load > x change the css to make it red (so I could notice it), etc. The css, the refresh, etc. is all simple, I am jut wondering how I could go about getting the load and memory use from PHP.I could setup a bash script that could get the info and spit it to a file as a last resort, but curious if there was a more direct way.
View 3 Replies View Relatedi'm using c++ and Ubuntu and I need to write/copy some files to a directory chosen by the user of my system (the user can save it on any folder of any disk of the pc or other usb device). Before I do it, I need to know if there's space available on the disk. I cannot only check the result of write() function, the validation must be executed before I start to save or copy.
I was trying to use statvsf structure, but I only have the complete filepath (/home/lobinho/myDocs/), not the disk path. The statvfs() function only works with disk path (i.e. /media/KINGSTON ).
The source of my function:
Code:
int MyClass::availableSpace(string dst, ulong* availableSize) {
int result = ERROR;
try {
struct statvfs devData;
[Code]...
I want to check if a MySQL db query will return an empty result - I first do this:
$query="SELECT * from <whatever" ;
$result=mysql_query($query) ;
$row=mysql_fetch_row($result) ;
Now how do I check if $row is empty or not? Will $row="" do the trick?
Greetings EveryOne
how to check if buffer is empty in c?
I'm writing a application which uses translates and I wonder how to check what has been prefix of it's installation to check where translation files are stored. I'm using cmake so maybe is there some preprocessor definition of installation prefix
View 4 Replies View RelatedWe are loading 100 + oracle tables using informatica. At the end of the run, we need to verify the informatica log to confirm the rows are loaded properly to target tables. There are so many detials included in the etllog. But,the part of the informatica log, linux script needs to look into look like as below -(vary for different table names. here, CMN_1740 is the table name.)
MAPPING> TM_6252 Source Load Summary.
MAPPING> CMN_1740 Table: [SQ_W_CASE_FS] (Instance Name: [SQ_W_CASE_FS])
Output Rows [1], Affected Rows [1], Applied Rows [1], Rejected Rows [0]
[code]....
1. The details of source load summary (source table name and the details -Output Rows [1], Affected Rows [1], Applied Rows [1], Rejected Rows [0]) should be written to a log. We need to check whether the affected rows is 0 or rejected rows > 0 for source load summary. In that case , script should write that to a log and exit
2. The details of target load summary (target table name and the details -Output Rows [1], Affected Rows [1], Applied Rows [1], Rejected Rows [0]) should be written to a log
3. We need to check whether the affected rows is 0 or rejected rows > 0 for target load summary. In that case, script should write that to a log and exit.
4.The above steps should be repeated for all set of tables mentioned in the etllog.
I'm messing with a JTree, I need one that has checkboxes to check/uncheck options, and (later) textboxes to edit options....but for now, the checkboxes don't wanna play. Here's the source:
package Habitat.EnvCtrl;
import java.awt.BorderLayout;import MailPopper.hlprs.CheckBoxNode;
import java.awt.Dimension;
import java.util.Vector;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeNode; .....
The rtree builds (albeit I have a superfluous extra checkbox in there I don't know where it comes from...) but I cannot check/uncheck any boxes.
i want a process that can operate as both a TCP echo server and a UDP echo server. The process can provide service to many clients at the same time, but involves a single process that does not start up any other threads.
View 3 Replies View RelatedI'm building a script for my place of employment. The next step in it is checking what the user input was. Determining if they added a part in there or not. The script prompts for a hostname. Hostnames are localhost.localdomain. Now, I want the script to check to see if they put localdomain and if they did, not to add the domain to the /etc/sysconfig/network, but just what they entered. So say the user inputs:
[Code]....