We are building our C++ project in Kdevelop IDE. Every time we run "Run Configure" from the "Build" menu, a file named "libtool" gets automatically generated. This file contains a statement as "ECHO="echo"".f we run "Automake", without modifying the "libtool" the system hangs and theputer needs to be restarted.Therefore every time we run "Run Configure" we need to include the line "echo="echo"" below the statement "ECHO="echo"" manually.I think a script can be written which does the above on its own.I am not a shell script programmer, I know the good tutorials for shell scripts are available on the net, but learning scripting only for this task would be time-consuming and painful.
Either the documentation on this -- or the eyes and brain I'm reading it with -- is/are clear as mud.This has been busted since I tried to install it a few months ago. <....>In short, what entries and parameters (and in what syntax) do I need to park in: /etc/sysconfig/hddtemp that the silly thing won't completely ignore?
I was able to get the printer up and running by downloading the printer driver for debian linux (3.1) from the Canon site without any problems.
Unfortunately I am not having the same luck with the scanner.
I tried downloading ScanGear MP for Linux (deb) (1.3) from the same Canon site but have not yet been able to get the XSane Image Scanner to recognize this scanner driver for my Canon.
I am trying to create a script to be used on RHEL server. If I replace the $t with a number, the script works. If I try add a variable or the $1, the script doesn?t work (returns all processes even if less than the $t value). I thought that it may be treating it as a literal, but I wasn?t sure of the conversion.
When you use an if statement directly in bash you have to put the ";" at the end or not? or am I mixing it with the for loop? I am reading advance bash scripting and it shows the if - then statements without ";" so I need a little clarification here.
I have a site which will have, for example, a login system where people have to enter their usernames and passwords, depending on which they'll be let in to the site. So, in code, I've got a line like:
if ($_POST['password'] == $password) { then do whatever } else { print "Wrong password" ; )
My problem is, this "Wrong password" printing is just a solitary line, not keeping with the colours and style of the site, and it looks very bad. I want to ideally, output some HTML, which will have a picture, and print the "Wrong password" in the font and colours I desire. Do I have to put all the HTML in a print statement, and then deal with the nightmare of escaping all the quote marks in it with a ""? Or is there a cleaner method to the whole thing? Maybe something like this -
if ($_POST['password'] == $password) { then do whatever }
I'm trying to code a sql statement for use in a PHP script.I'm looking to find the number of matching records in two tables and display them.How would you write that statement.I've tried using count a few ways, but no cigar.
I'm working on a backup script which takes the following input:
Code: RevBackup.sh <options> <source> <target>
The problem I'm having is that the source and target might contain spaces in the path. ie. /home/eRJe/My Documents
I would like the script to ignore " " (backslash-space) as being a delimiter. how could I do this without stopping a normal space from being a delimiter?
I could do this with IFS. But so far I have only found info about setting a delimiter and not to "ignore" one
the following works and BASH doesn't complain, but VIM highlights the closing square bracket is if it sees a syntax error. Is there a better way to express regex in a case statement or is this an issue with VIM?
The script that Iam trying to write is running a for loop and reading line by line from a text file. inside this for loop i would like to execute update SQL statement .
a pesudo code is Quote: `$ISQL -U $username -P $Password -D $Dbname -I $INTERFACE <<QRY for id in $idlist #idlist iam reading from a file
It is under PHP/MySQL $queryresult = $conn->query("INSERT INTO normalrequests VALUES($finalkey, 1234, 5678, FALSE)"); It is connected to the database successfully but I feel there is something wrong with the statement up there.
This script that I found online does the job it promises. it does convert the files to mp3 without an issue. What I need to include now is an if statement that says If $file.mp3 exists then delete $file.wav
Code: #!/bin/sh # name of this script: wav2mp3.sh # wav to mp3 # Credit to the script creator (Nikesh Jauhari):
[Code]...
After that I'm stumped as to how to do the if statement
As you can see, I want to pass arguments depending on the option(s) chosen by the user; ie. --snooze, or --channel. By default, if no options are chosen, I'll display a usage message; though in the future I'll provide some sane defaults. I'd like to create a case statement to handle passing arguments to any number of options; something like:
Code:
wakethehellup.sh --snooze 20 --message 'wake up!'
and for the other arguments, it would have a default set. The case statement I provided fails with a syntax error "syntax error near unexpected token `$2'" near the '--snooze' in the statement, so I take it you can't pass a parameter in this way; but I'm confused as to how I'm supposed to pass different parameters to different options without the options being confused as parameters.
Both lines are new lines, so they won't be inline. Other than that, they are all constants, I want this regex match to be an if statement rather than returning match string. so if the $content variable contains some string that matches:
A question of ODBC correctness - maybe someone knows.
Code: // statement handle is sth, connection handle is dbch SQLExecDirect(sth, ...); // ... bind var, fetch results ... SQLFreeHandle(SQL_HANDLE_STMT, sth); // free statement handle SQLEndTran(SQLHANDLE_DBC, dbch, SQL_COMMIT); (error checking removed for clarity).
To my mind this seems wrong - surely the statement handle should be free'd only after the commit is done? Or maybe not. I theorize about the ODBC library like this: a whole set of statements can be created, run, executed in one transaction (which is held at the connection level), and only after all that is a commit/rollback done. So maybe it's OK. Even so it still feels weird. What is written above works, but there are rare and very difficult to replicate problems with this code, and I wonder if a premature free might be the cause...?
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
I was doing an exercise on Learning Perl, 3rd edition. (exercise chapter 10 btw) The problem asks to create a program that generates a random number and asks the user to guess. It should tell the user if the guess is lower or higher and exit if the user types either exit or quit. My code is the following:
How do I write my trap statement in shell script to ignore SIGINT.Reason being is that the script is used to update records in database. I want to avoid inconsistency in database when user presses Ctrl-C .The result should be
1. Totally ignore Ctrl-C (SIGINT) when user presses Ctrl-C 2. Continue with the rest of processing
I'm studying an OS programming book, in particular network sockets. I have two questions(2nd one is down at the bottom). There is something I don't quite understand. What if this piece of code, which sets sigpipe's default action to ignore and opens a socket:
I have to enhance the behaviour of a backup script written in perl. I don't need to change it, what I need to do is to create a bash script that does some checks like file name and file size, execute the backup script then check if the backup files match the original files.Here's how I try to do it:
- read the files from the original files folder - store them in an array - search in the array the files that have a specific file extension - store the file names that match the search pattern (I know the backup script skips some files so I can hardcode the search pattern) - run the backup script - read the files from the backup folder - store them in an array - compare the original files name and size stored in an array with those from the backup folder - send a report email
I was able to get my Epson Stylus NX510 printer up and running (after much issue), but I can't get the scanner working. I'm on a laptop, and the printer/scanner is wifi enabled and broadcasts with its own IP address. I can print with no problem, but xsane and simple scan don't recognize the scanner. I'm running Ubuntu 10.04 Lucid Lynx.
After downloading and installing iscan and run it i see this message:
Could not send command to scanner. Check scanner's status.
After command sane-find-scanner:
And this message is result of scanimage command:
No scanners were identified. If you were expecting something different, check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool (if appropriate). Please read the documentation which came with this software (README, FAQ, manpages).