shell

Bazaar syntax to ignore directories matching a wildcard

I'm sure this is a dumb question, but what is the syntax to ignore my _Resharper.* directories with Bazaar? I've tried ignoring: \_Resharper*.* ./\_Resharper*.*, **/\_Resharper*.*, plus variations of those on the wildcards. No matter what I do, it continues to pick up the directory. ...

Environment variable used in shell script appear blank in log file when run by cron

Forgive my ignorance, but I am somewhat new to shell scripting and the use of environment variables in Linux. I have a script that performs a backup of a MySQL database. I have the following lines in the script that are used to log a successful dump of the database: output=`date; echo "Database export successful from $ENV_HOSTNAME to ...

SHBrowseForFolder doesn't work for network selection in win7

Hi, I use SHBrowseForFolder in my code. It works well in XP. But I find it dose not run well in Windows 7 with the same code. When I click a network, it does nothing. But it can expand in XP. By the way, I have the permission to access the network of another computer and I try accessing the resource with explorer, it's OK! Can anyon...

Need help in executing the SQL via shell script and use the result set.

Hi All, I currently have a request to build a shell script to get some data from the table using SQL(ORACLE). The query which I'm running return n number of rows.. Is there a way to use something like result set. Currently , I'm re-directing it to a file, but I'm not able to reuse the data again for the further processing.. Any hel...

Custom-designed Shell doesn't work on Windows 7

Hi everyone. We have a Server/Client cybercafe management application which used to work fine on Windows XP and Vista but now fails to run on Windows 7. The Client was supposed to get 'Locked' on Client PCs of the Cybercafe, meaning it replaced Windows Explorer by changing the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windo...

How to get a part of String using shell script?

I have a requirement in a shell script. I get this location information from a text file; it is always valid. /opt/sasuapps/senny/publish/gbl/SANDHYA/drop1 I need to check if the directory is empty or not which I have done. If the directory is not empty, I need to delete the files and directory under that location. As a part of sec...

date in shell script

Hi All, I have a shell script with a lot of echo statements. I want to prefix each line of output with the time/date. So, I replaced every echo "Some text1" echo "Some text2" with echo "`date +%y/%m/%d_%H:%M:%S`:: some text1" echo "`date +%y/%m/%d_%H:%M:%S`:: some text2" This is rather ugly. Is there anyway to create an alias (o...

Perform OR on two hash outputs of sha1sum.

Hi I want perform sha1sum file1 and sha1sum file2 and perform bitwise OR operation with them using bash. Output should be printable i.e 53a23bc2e24d039 ... (160 bit) How can I do this? I know echo $(( 0xa | 0xb )) but how to extend to 40 hexadecimal digits? Thanks ...

validation tool for shell scripting

Is there any validation tool for shell scripting on unix platform. like after the completion of the script the tool validates it and warns us of eroors? ...

Book recommendation for Unix shell commands

Hi, I want to learn more about UNIX shell commands, so I am searching a good book, that explains the most needed shell commands and how to get better on the terminal in general. I am using Ubuntu(Debian). The book should not have more than ~250 pages. I am neither a noob nor a pro using the terminal. Best regards ...

Export variables from one shell script to another.

Hi, I have a couple of scripts for which the first part of them looks the same. Function of this part is to identify at which machine the script is being runned and set a couple of variables accordingly. It looks something like this: ENV=`echo $LOGNAME | cut -c1-8` if [ $ENV = "vrt3400b" ] then echo "Using TEST specific settings...

Shell script variables - command not found

I have a shell script that will let me access global variables inside the script, but when I try to create my own, it responds with: command not found. #!/bin/bash J = 4 FACE_NAME = "eig$J.face" USER_DB_NAME = "base$J.user" When I run the above script I get: ./test1.sh line 2: J: command not found ./test1.sh line 3: FACE_NAME: comman...

Cocoa shell command permission

Hi I'm developing my first Mac App have some issues with shell commands... I'm trying to find out how to get the permission windows that the user can enter his password. I want to copy a picture in a system folder, and change the name of another picture too. I try to change the Login window background. Command 1: "sudo mv DefaultDes...

Shell variable with spaces , quoting for single command line option

Autoconf scripts have trouble with a filename or pathname with spaces. For example, ./configure CPPFLAGS="-I\"/path with space\"" results in (config.log): configure:3012: gcc -I"/path with space" conftest.c >&5 gcc: with: No such file or directory gcc: space": No such file or directory The compile command from ./configure is ac...

Using Ruby popen and PostgreSQL createuser

Hello all, I am attempting to write a very simple rake task (and merge it into a rather large rake task) that will call the following command and pass in a randomly generated password. For the moment, let's even fake the random generation and just give it a set password of 'test': createuser -SDPRE test The code I have for my task is...

Can I get around the launch timeout when running scripts from SpringBoard?

I like to write bash shell scripts on my iPhone, put them in an app folder with an icon, plist, etc., so they execute like apps by tapping their icon on SpringBoard. This is not interactive like MobileTerminal since there is no way to get output, but it has its uses. It works great for simple scripts, but long scripts get timed out with...

SQL*Plus inside Perl script

I am having a prior knowledge of shell scripting. I am trying to connect to a table using SQL*Plus and fetch the data in a Perl script and store that output in a Perl variable. Normally in a shell script I would do like below: SQL_RESULT=`sqlplus -s ${CONNECT_STRING} << EOF ${SQLPLUS_SETTINGS} select foo||'|'||bar ||'|'|| xy...

[Unix Query] Command/Script for Accurate command HISTORY?

Hi Is there some command/script to know “EACH & EVERY” command executed on a solaris machine (with timestamp if possible) when multiple users are logged in with “SAME USERID & PASSWORD”? history command is not accurate. It just shows the history of commands executed by that user or sometimes few more but it is not accurate when the s...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks ...

IThumbnailProvider and IInitializeWithItem

I am trying to develop an IThumbnailProvider for use in Windows 7. Since this particular thumbnail would also be dependant on some other files in the same directory, I need to use something other than IInitializeWithStream to a path to work with, this being IInitializeWithItem. (Alternatively, I could use IInitializeWithFile, but that is...