Monday, February 21, 2011

[: missing `]' +bash +shell scripts

 "=" sign requires a blank in front of it and after it. Otherwise, the bash only sees "something" within the brackets, and that is true (0), while "nothing" is false (1):

ex.
[ 5 = 6]
 
solution 
[ 5 = 6 ] 
 
 
Tutorials:
http://wiki.linuxquestions.org/wiki/Bash_tips
http://www.tldp.org/LDP/abs/html/
https://wiki.archlinux.org/index.php/Color_Bash_Prompt 

Wednesday, February 9, 2011

Solution: merge two files / append two files in Linux

Code:
cat file1 file2 .. fileN  > mergedfile
Note the '>' in the command: it points that the target file follows, don't forget to put it there.

Advance:
 
If you accept that entries in the resulting file are sorted, you can use uniq to remove duplicates.

Code:
cat file1 file2 | sort | uniq > mergedfile

Thursday, February 3, 2011

Solution : raise TypeError("bufsize must be an integer")

Error : subprocess.call(['vim'],['/home/patelm/.bashrc'])

Solution: subprocess.call(['vim','/home/patelm/.bashrc'])


Whenever you're running subprocess.call and you see this
error, say to yourself: "Have I passed the command line
as one parameter in a list; or have I passed it as a series
of parameters?"

Wednesday, February 2, 2011

diff rcs file

Code:
rcsdiff -r1.1 -r1.2 -u file

here we are diffing rev 1.2 agains 1.1


If you want to colour the output you can use the idiff script


Code:
rcsdiff -r1.1 -r1.2 -u file | ./idiff

Friday, January 28, 2011

How to view content of RPM package

use following switch

--filesbypkg
    List all the files in each selected package.

rpm -q -filesbypkg -p filename.rpm

Wednesday, January 12, 2011

Word 2007: Password Protect Your Document File

1. Click the Microsoft Office Button, and then click Save As.
2. Click Tools, and then click General Options.
3. You can type a password in Password to open or Password to modify.
4. Click OK.
5. When prompted, retype your passwords to confirm them, and click OK.
6. Click Save.

ref:- http://www.technipages.com/word-2007-password-protect-your-document-file.html

Wednesday, December 1, 2010

Solution :called too early to check prototype at in Perl

one of the way shis can happen if

you have declared function as

sub fun()
{

}


In perl you should declare function as

sub fun
{

}


- mihir patel

Tuesday, November 23, 2010