bourne

CruiseControl.rb PATH

I'm trying to get CruiseControl.rb to run rcov during a build. It's currently failing with the following error: sh: rcov: not found Since I can run rcov from the shell when I log in, I figure that this is a PATH problem. (Additionally, I can run both rake test:rcov and rake cruise from the shell without errors). I added a p 'echo $PA...

get a list of function names in a shell script

I have a Bourne Shell script that has several functions in it, and allows to be called in the following way: my.sh <func_name> <param1> <param2> Inside func_name() will be called with param1 and param2. I want to create a "help" function that would just list all available functions, even without parameters. The question: how do I ge...

Bourne Shell: Graceful way to get exit status

Is there a more graceful way to do this (bourne shell)? IsThereAnyApplesLeft applesLeft=$? Normally in c or java I would do: applesLeft=IsThereAnyApplesLeft ...

Bourne: if statement testing exit status

What is the difference: if IsServerStarted ; then ... and if [ IsServerStarted -eq 0 ] ; then ... Seems to me that these two statements should be equivalent? Strangely the second statement is always true. ...

Bash or Bourne Scripts?

Is it better practice to write Bash scripts or Bourne scripts? My team writes Bourne scripts but I am not entirely sure why. If this is a holy war question (ie: vim vs. emacs) please just reply: holy war. ...

How do i compare 2 strings in shell?

I want the user to input something at the command line either -l or -e. so e.g. $./report.sh -e I want an if statement to split up whatever decision they make so i have tried... if [$1=="-e"]; echo "-e"; else; echo "-l"; fi obviously doesn't work though Thanks ...

Bourne: How to preserve a string in a variable?

Hello, I'm trying to execute the following line in Bourne: LIST="-foo, -bar, baz" However, I am getting an error: -bar: command not found Can anyone help me figure this out? Thanks! ...

Bourne Shell Building and referencing a variable

I have a shell that runs where the preset env variables include: FOOCOUNT=4 FOO_0=John FOO_1=Barry FOO_2=Lenny FOO_3=Samuel I can not change the way I get this data. I want to run a loop that generates up the variable and uses the contents. echo "Hello $FOO_count" This syntax is however wrong and that is what I am searching for......

Reading from an archive using Bourne Shell

I am trying to use Bourne shell scripting for the first time ever, and I cannot seem to figure out determining how to save text from a file to internal script variables. The file format is as follows: acc.text Jason Bourne 213.4 Alice Deweger 1 Mark Harrington 312 The current script that I have (which might be ENTIRELY incorrect as I...

How to get a password from a shell script without echoing

I have a script that automates a process that needs access to a password protected system. The system is accessed via a command-line program that accepts the user password as an argument. I would like to prompt the user to type in his/her password, assign it to a shell variable, and then use that variable to construct the command line ...