OpenGrok: ClearCaseRepository not working (missing binaries?) - clearcase

When starting Catalina run, I get the following warning:
WARNING: ClearCaseRepository not working (missing binaries?):
Any idea, anyone?
Thanks, Avi

This is similar to this thread (I will adapt the following extract to your case):
As far as I can see from the code, this warning can only happen if the command "git --help" [in your case cleartool -version] exits with a non-zero exit code.
What do you see if you log in as the tomcat user, set the PATH like you do in startup.sh, and then execute following commands
cleartool -version
echo $?
Check the logs (catalina.out) after adding the following line to your Tomcat's conf/logging.properties:
org.opensolaris.opengrok.level=ALL

Related

CMake command query (add_custom_command)

I was using the following command for generating Checksum value, .hex and .bin files.
Unfortunately an error comes in the first.
I'm getting error in generating checksum.
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} --fill; 0xFF;0x0-0x3CFFD;--checksum=__checksum:2,crc16,0x0;0x0-0x3CFFD
COMMAND ${CMAKE_OBJCOPY} --ihex ${CMAKE_SOURCE_DIR}/Output/exe/${CMAKE_PROJECT_NAME}.elf ${HEX_FILE}
COMMAND ${CMAKE_OBJCOPY} --bin ${CMAKE_SOURCE_DIR}/Output/exe/${CMAKE_PROJECT_NAME}.elf ${BIN_FILE}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Output/exe
COMMENT "Building ${HEX_FILE} \nBuilding ${BIN_FILE}")
The error pop up as
ielftool error: Missing separator in command line option (expected ';'): "0xFF"
Can anyone help out here? It will be a great help.
Thanks.
I was stucked on the same problem by using ielftool in postBuild via IAR Linux Compiler. At the end I got it running but there are some rules to be considered:
the ";" separator has to be written in quotation marks "';'" ("slash" works also)
last arguments of out-file must be wrapped by ""
spae characters between arguments cause some errors
Example:
/opt/iarsystems/bxarm/arm/bin/ielftool --fill 0xFF';'$FLASH_START-$FLASH_START_HEADER --fill 0xFF';'$FLASH_PROGRAMMCODE_START-$FLASH_PROGRAMMCODE_END --checksum __checksum:4,crc32,0x0';'$FLASH_START-$FLASH_START_HEADER';'$FLASH_PROGRAMMCODE_START-$FLASH_PROGRAMMCODE_END --verbose "$INPUT_FILE" "$INPUT_FILE"
#/opt/iarsystems/bxarm/arm/bin/ielftool --fill 0xFF\;$FLASH_START-$FLASH_START_HEADER --fill 0xFF\;$FLASH_PROGRAMMCODE_START-$FLASH_PROGRAMMCODE_END --checksum __checksum:4,crc32,0x0\;$FLASH_START-$FLASH_START_HEADER\;$FLASH_PROGRAMMCODE_START-$FLASH_PROGRAMMCODE_END --verbose "$INPUT_FILE" "$INPUT_FILE"

Error in creating array variable in Debian 8.4

I have a very basic shell script containing
#!/bin/sh
NAME[0]="Hello"
echo ${NAME[0]}
So when I run this script an error occurs stating
./test.sh: 2: ./test.sh: NAME[0]=Hello: not found
./test.sh: 3: ./test.sh: Bad substitution
So basically I looked through a few tutorials and found this to be the basic way to declare arrays. So I am confused as to why this is an error. Any ideas?
You are starting your script as #!/bin/sh, which has a soft link to dash (The current version of sh which conforms with the POSIX 1003.2 and 1003.2a specifications for the shell) and dash doesn't support arrays. In debian 8 onwards dash has become default shell, so if you run ls -la /bin/sh the output will be /bin/sh -> dash
However bash still remains the default login shell, only the default /bin/sh used in shell scripts has been changed. So if you run your code on terminal, it will work just fine. More information on why this switch was made in Ubuntu can be found here.
If you want to use arrays in your script then you must start your script with #!/bin/bash
So your script works perfectly if modified like this
#!/bin/bash
NAME[0]="Hello"
echo ${NAME[0]}
More information on Dash as Sh DashAsBinSh

I am getting error "array.sh: 3: array.sh: Syntax error: "(" unexpected"

I have written the following code:
#!/bin/bash
#Simple array
array=(1 2 3 4 5)
echo ${array[*]}
And I am getting error:
array.sh: 3: array.sh: Syntax error: "(" unexpected
From what I came to know from Google, that this might be due to the fact that Ubuntu is now not taking "#!/bin/bash" by default... but then again I added the line but the error is still coming.
Also I have tried by executing bash array.sh but no luck! It prints blank.
My Ubuntu version is: Ubuntu 14.04
Given that script:
#!/bin/bash
#Simple array
array=(1 2 3 4 5)
echo ${array[*]}
and assuming:
It's in a file in your current directory named array.sh;
You've done chmod +x array.sh;
You have a sufficiently new version of bash installed in /bin/bash (you report that you have 4.3.8, which is certainly new enough); and
You execute it correctly
then that should work without any problem.
If you execute the script by typing
./array.sh
the system will pay attention to the #!/bin/bash line and execute the script using /bin/bash.
If you execute it by typing something like:
sh ./array.sh
then it will execute it using /bin/sh. On Ubuntu, /bin/sh is typically a symbolic link to /bin/dash, a Bourne-like shell that doesn't support arrays. That will give you exactly the error message that you report.
The shell used to execute a script is not affected by which shell you're currently using or by which shell is configured as your login shell in /etc/passwd or equivalent (unless you use the source or . command).
In your own answer, you say you fixed the problem by using chsh to change your default login shell to /bin/bash. That by itself should not have any effect. (And /bin/bash is the default login shell on Ubuntu anyway; had you changed it to something else previously?)
What must have happened is that you changed the command you use from sh ./array.sh to ./array.sh without realizing it.
Try running sh ./array.sh and see if you get the same error.
Instead of using sh to run the script,
try the following command:
bash ./array.sh
I solved the problem miraculously. In order to solve the issue, I found a link where it was described to be gone by using the following code. After executing them, the issue got resolved.
chsh -s /bin/bash adhikarisubir
grep ^adhikarisubir /etc/passwd
FYI, "adhikarisubir" is my username.
After executing these commands, bash array.sh produced the desired result.

Clearcase error reports

Is there a way to mute or remove error messages from a Clearcase command such as mklabel? I'd like to suppress error messages from the mklabel command if possible.
The scripts you see in this thread (or this one, or in one of the ten best scripts) usually employ the same technique:
cleartool mklabel ... 2> /dev/null
In a perl script for instance:
my $cout = `cleartool desc $pn##\/$lbtype 2>/dev/null` ;
This is part of cleartool output redirection techniques.
I prefer redirecting stderr in a file, that I can parse (after executing the command) to detect rare errors, while ignoring all the warning (like label already existing and moved).
But the main idea remains: for a cleartool mklabel, there is no -silent or -quiet option.

tcshrc setting path getting error

im trying to set the environment path to run pintos command like this in my home floder under ubuntu
set path = ($path /home/pintos/src/utils)
and I type terminal command try to compile this
:~$ source .tcshrc
but it seems get error like this
bash: .tcshrc: line 1: syntax error near unexpected token `('
bash: .tcshrc: line 1: `set path = ($path /home/pintos/src/utils)'
I dont know where is the syntax error is ...
You source your script, which is perfectly valid for [t]csh, into your running shell, which happens to be bash (and not tcsh).
If you're going to use tcsh, just run it (by typing tcsh) and ensure that your ~/.tcshrc has the desired effect. (Then, maybe, use chsh to change your login shell).
If you're going to use bash, set path using PATH=$PATH:/home/pintos/src/utils, in ~/.bashrc and/or in ~/.bash_profile.

Resources