Run Feat FMRI analysis & fSLeyes in (FSL in 6.0.5.2) on Ubuntu [Failed] - ubuntu-20.04

I wanted to run a Feat FMRI analysis & fSLeyes in (FSL in 6.0.5.2) at boot in Ubuntu. I am facing these errors.
Feat FMRI analysis
Error in startup script: sh: 1: /usr/local/fsl/bin/tmpnam: Permission denied
while executing
"exec sh -c "${FSLDIR}/bin/tmpnam /tmp/feat" "
(procedure "feat5:setupdefaults" line 73)
invoked from within
"feat5:setupdefaults"
(procedure "feat5" line 6)
invoked from within
"feat5 .r"
invoked from within
"if { ! [ info exists INGUI ] } {
wm withdraw .
feat5 .r
tkwait window .r
}"
(file "/usr/local/fsl/tcl/feat.tcl" line 522)
invoked from within
"source ${FSLDIR}/tcl/${origname}.tcl"
(file "/usr/local/fsl/bin/Feat" line 22)
FSLeyes
sh: 1: /usr/local/fsl/bin/fsleyes: not found
I executed these commands, but it didn't work. Can anyone help me?
chmod u+x /usr/local/fsl/bin/tmpnam

Related

How can we output error in Jenkins when using SSH Publishers plugin

i have a shell script in remote server
mcccc 1
$ sh -x demo.sh
+ mcccc 1
demo.sh: line 4: mcccc: command not found
in Jenkins project configure page
exec command box of SSH Publishers setting section
sh -x demo.sh
but in console output of Jenkins, I only get the error below
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [127]]
Finished: UNSTABLE
how to get "demo.sh: line 4: mcccc: command not found" message

Error when using mpirun with a shell script

When I run
mpirun -np 4 mpi_script.sh
I get the error
Open MPI tried to fork a new process via the "execve" system call but failed.
...
Error: Exec format error
despite the fact that I can run the script with ./mpi_script.sh
In my case the problem was I didn't have a shebang.
Adding #!/usr/bin/env bash to the top of my script fixed it:
#!/usr/bin/env bash
# rest of script
# ...
N.b. be sure that the file has execute permissions:
chmod +x mpi_script.sh

Running gogo shell client api commands via shell script

I am trying to run create targets via gogo shell client api.
I have written a script which starts the client.jar from apache ace distribution.
Then I am trying to run the gogo shell client api commands in the same script.
The script code is:
#!/bin/bash
This cmd starts the gogo shell:
java -Dagent.discovery.serverurls="http://localhost:8080" -Dorg.apache.ace.r="localhost:8080" -Dorg.apache.ace.obr="localhost:8080" -Dorg.osgi.service.http.port=-1 -Dorg.apache.ace.configurator.CONFIG_DIR="/path/apache-ace-2.0.1-bin/client/conf" -Dace.gogo.script.delay="3000" -jar /path/apache-ace-2.0.1-bin/client/client.jar & MyPID=$!
echo $MyPID
This creates a workspace in the gogo shell:
w = (cw)
$w cf property-feature
$w lf
But when i run the script i get an error saying
./script.sh: line 6: syntax error near unexpected token ('
./script.sh: line 6: `w = (cw)'
Note:
I am trying to manually run the script by running ./script.sh in the terminal. Any ideas on this would be really helpful.

Cygwin .sh file run as Windows Task Scheduler

Having issues getting this shell script to run in windows task scheduler.
#!/bin/bash
# Script to ping the VPN server for testing
RESULT=$(ping 192.168.1.252 | grep "Lost" | awk {' print $10 '})
LOG=/home/admin/results.txt
if [ "$RESULT" -gt 0 ];then
echo "VPN 192.168.1.252 NOT pinging" >> $LOG
else
echo "VPN Online"
fi
When I run it in cygwin, it runs with no issue, but when I attempt to run it from command prompt, I get the following:
C:\cygwin64\bin>bash test.sh
test.sh: line 4: grep: command not found
test.sh: line 4: awk: command not found
test.sh: line 7: [: : integer expression expected
My question is, how do I get it to run with bash instead so that it actually knows the grep and awk commands?
In Windows Scheduler, I have Action: Start A Program
Details: C:\cygwin64\bin\bash.exe
Argument: test.sh
Start in: C:\cygwin64\bin
Am I missing something?
I figured it out.
In the Windows Task Scheduler, I had to pass:
Program/script: C:\cygwin64\bin\bash.exe
Add arguments: -c -l test.sh
Start in: C:\cygwin64\bin
In correction to what Jimmy found:
Add arguments: -c -l "c:/FileFolder/test.sh"
You don't need the Start in argument anymore.
For the longest time I was experiencing the same issue as the OP: command not found errors when trying to run a shell script from Task Scheduler or the Command Prompt, despite the fact that running the same script from a Cygwin terminal worked fine.
After some more research I eventually realised that the reason was because my usual Bash PATH ~/.bashprofile wasn't being loaded, and that I needed to use Windows' Environment Variables window to add C:\cygin64\bin to my PATH environment variable (system or user, it doesn't really matter). This directory contains common system executables like grep and awk, which is why Bash is unable to locate them until the path is added to Windows' PATH.

trying to start XBMC with a bash from BOXEE

Hi new to unix and bash programming. I am trying to make a simple startup script to have my boxee start up XBMC that is stored on a Memory card. I can start the commands by entering them in telnet, but if i call the test.sh script it wont allow me to access the directory where XBMC is stored on.
#!/tmp/mnt/6337-3533/xbmc
BASEDIR=/tmp/mnt/6337-3533/xbmc $0
killall U99boxee; killall BoxeeLauncher; killall run_boxee.sh; killall Boxee; killall BoxeeHal
GCONV_PATH=$PWD/gconv AE_ENGINE=active PYTHONPATH=$PWD/python2.7:$PWD/python2.7/lib-dynload XBMC_HOME=$PWD ./xbmc.bin -p
gives:
# sh test.sh
: not foundne 2:
: not foundne 3:
test.sh: line 4: /tmp/mnt/6337-3533/xbmc: Permission denied
: not foundne 5:
: not foundne 6:
killall: U99boxee: no process killed
killall: BoxeeLauncher: no process killed
killall: run_boxee.sh: no process killed
killall: Boxee: no process killed
: no process killed
: not foundne 9:
: not foundne 10:
test.sh: line 11: ./xbmc.bin: not found
#
i used the command line from xbmc. and i assume the $PWD expects the script to be in /tmp/mnt/6337-3533/xbmc
if I enter "cd /tmp/mnt/6337-3533/xbmc" in telnet it wil bring me to the dir
but if i put that code in the script, it will give me access denied.
What am i doing wrong here. or how can i approach this so i wont have to change my work directory?
Line 2 will expand to
BASEDIR=/tmp/mnt/6337-3533/xbmc test.sh
This will try to run test.sh with the /tmp/mnt/6337-3533/xbmc interpreter specified on line 1, which will fail since that is a directory. Line 1 doesn't have to specify a valid interpreter if you're going to run the script by doing 'sh test.sh', but you'll probably be happier if you change line 1 to
#!/bin/sh
If you just want the invocation of xbmc.bin to see the value for BASEDIR in its environment, replace line 2 with
BASEDIR=/tmp/mnt/6337-3533/xbmc
export BASEDIR

Resources