Syntax error: `]' unexpected


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Syntax error: `]' unexpected
Prev   Next
# 4  
Old 08-19-2019
Quote:
Originally Posted by cokedude
This is for my .profile file. ksh is my default and I want it to switch to bash.
I gave you a pointer in your previous thread on this subject. Forcing a shell to source the .bashrc file does not turn it into bash. Your default shell when logging in will be in the $SHELL variable (unless somebody knows better). So if you cannot change your default shell to bash try something like this at the end of your .profile:
Code:
case "$SHELL" in
*bash) . ./.bashrc ;;
*ksh) 
   for b in /bin/bash /usr/bin/bash /usr/local/bin/bash
   do
      if [ -x "$b" ]
      then
         SHELL=$b
         export SHELL
         exec $SHELL
      fi
   done
   . .kshrc
   ;;
esac
. ./.kshrc ;;
esac

Andrew
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Syntax error near unexpected token

Dears, While executing the below script im getting the error at line 30. Please let me know what changes to be done to fix this. test.sh: line 30: syntax error near unexpected token `done' test.sh: line 30: ` done ' #!/bin/sh # Rev. PA1 # author: eillops # date: 26-04-2018 # #... (1 Reply)
Discussion started by: Kamesh G
1 Replies

2. Shell Programming and Scripting

Syntax error `(' unexpected

I have written this in my script but while running i am getting syntax error `(' unexpected. unload to "$BACKUP_DIR/n_fac_fid-$clliname" select * from n_fac_fid where fac_accesskey in (select fac_accesskey From n_fac_ap_fid where ap_clli="$clliname"); Any help appreciated. (3 Replies)
Discussion started by: suryanmi
3 Replies

3. Shell Programming and Scripting

Syntax error: 'fi' unexpected

unzip file.zip if ] ; then echo "Success" else echo "Some failure." fi ; I tried many time to detect the unzip error, but it keep show the syntax error wherever how I change the syntac. Hope someone can help me fix the issue, thanks. Please use code tags next time for your code and... (5 Replies)
Discussion started by: duncanyy
5 Replies

4. Shell Programming and Scripting

Syntax error near unexpected token `else'

Hi, I am trying to read the session log through script. But it keeps showing me some error near. I have tried everything. Even tried converting the script using sed command to remove the hidden characters(\r).But nothing seems to be working.Below is the script : #!/bin/bash cd... (6 Replies)
Discussion started by: Aryan12345
6 Replies

5. Shell Programming and Scripting

Syntax error near unexpected token `}' please help

I'm going mad not being able to get this to work. im assuming its only a simple mistake but its driving me bonkers trying to find it. Please if you can help me it would save me pulling my hair out!! Thanks #!/bin/bash -xv # #Config name="TEST Server" + name='TEST Server'... (6 Replies)
Discussion started by: Fisheh
6 Replies

6. Shell Programming and Scripting

syntax error: `$' unexpected

Hi all, Am very new to Unix and am currently Involved in Migrating some Shell Scripts from AIX 4 to Solaris 10. While using teh for loop am getting the below error: $ echo $SHELL /usr/bin/ksh $ for file in $(ls *SEBE*) syntax error: `$' unexpected while the same works without issue on... (4 Replies)
Discussion started by: paragkhanore
4 Replies

7. UNIX for Advanced & Expert Users

syntax error near unexpected token '{

Hi, I am running the following script through cygwin and getting below mentioned error. ******************************************* #!/bin/sh # constants WORK_DIR="deploy" INFOFILE="deploy.info" INTROFILE="Intro.sh" CMGMT_PKG="com.kintana.cmgmt.deploy" DEPLOY_PREFIX="mitg" ... (2 Replies)
Discussion started by: MandyR
2 Replies

8. Shell Programming and Scripting

Syntax error near unexpected token `('

Guys , This is an output of my script errored out for "Syntax error near unexpected token `(' " Can someone tell me whats wrong with my script. Below is my original script pasted. #!/bin/bash Script Creation Date 01/21/2010 Author baraghun ... (7 Replies)
Discussion started by: raghunsi
7 Replies

9. Shell Programming and Scripting

unexpected syntax error

Hi, i am getting following syntax error ...kingly advice why is it coming ?? #!/bin/bash find . -name "common.log" if ; then echo "1" fi Himnashu@home /bin $ ./a.sh ./a.sh: line 7: syntax error near unexpected token `fi' ./a.sh: line 7: `fi' (9 Replies)
Discussion started by: himvat
9 Replies

10. Shell Programming and Scripting

sh: syntax error: `...' unexpected???

Hello all, I want to create a script that polls every hour a directory for the existence of a file. The file I look for is a `token` dropped by an external process at the completion of a successful FTP process. I wrote this script `checkfile.ksh`: #!/usr/bin/ksh if ] then mailx... (5 Replies)
Discussion started by: alan
5 Replies
Login or Register to Ask a Question
MPI_File_get_position(3OpenMPI) 										   MPI_File_get_position(3OpenMPI)

NAME
MPI_File_get_position - Returns the current position of the individual file pointer. SYNTAX
C Syntax #include <mpi.h> int MPI_File_get_position(MPI_File fh, MPI_Offset *offset) Fortran Syntax (see FORTRAN 77 NOTES) INCLUDE 'mpif.h' MPI_FILE_GET_POSITION(FH, OFFSET, IERROR) INTEGER FH, IERROR INTEGER(KIND=MPI_OFFSET_KIND) OFFSET C++ Syntax #include <mpi.h> MPI::Offset MPI::File::Get_position() const INPUT PARAMETER
fh File handle (handle). OUTPUT PARAMETERS
offset Offset of the individual file pointer (integer). IERROR Fortran only: Error status (integer). DESCRIPTION
MPI_File_get_position returns, in offset, the current position of the individual file pointer in etype units relative to the current dis- placement and file type. FORTRAN 77 NOTES The MPI standard prescribes portable Fortran syntax for the OFFSET argument only for Fortran 90. Sun FORTRAN 77 users may use the non-por- table syntax INTEGER*MPI_OFFSET_KIND OFFSET where MPI_ADDRESS_KIND is a constant defined in mpif.h and gives the length of the declared integer in bytes. ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ func- tions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. For MPI I/O function errors, the default error handler is set to MPI_ERRORS_RETURN. The error handler may be changed with MPI_File_set_errhandler; the predefined error handler MPI_ERRORS_ARE_FATAL may be used to make I/O errors fatal. Note that MPI does not guarantee that an MPI program can continue past an error. Open MPI 1.2 September 2006 MPI_File_get_position(3OpenMPI)