Sponsored Content
Top Forums Shell Programming and Scripting Execute shell script without using sh Post 302626461 by cero on Thursday 19th of April 2012 10:20:31 AM
Old 04-19-2012
I think the best advice was given in zaxxons second sentence: call the script by specifying its path. When you issue ./test.sh you specify a relative path with the dot standing for your current directory.
Adding the current directory (dot) to your path-variable can have undesired effects (imagine you mistype something and your current directory contains some 10.000 files...), but using paths is good practice anyway, especially when it comes to automate something using cron.
@methyl: unfortunately SAP uses csh for its os-users, at least the last time I had to work with it...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to execute shell Script?

I am new to UNIX , Can any one let me know how to execute shell script (i.e which command I have to use for the same). Any help would be appreciated. Thanks siva mymvs999@yahoo.com (3 Replies)
Discussion started by: siva
3 Replies

2. UNIX for Dummies Questions & Answers

Execute Shell Script

Hi all, I am begginer of UNIX . I dont know if i have a script written in korn shell with .ksh extention . If i want to execute that how can i do that? Can anybody suggest the best book to learn korn shell scripting. Thanks sam71 (1 Reply)
Discussion started by: sam71
1 Replies

3. UNIX for Dummies Questions & Answers

To call/execute a shell script from a shell script

Hi , I have 4 shell scripts a.ksh b.ksh -> depends on a.ksh success -> log into b.log c.ksh -> depends on b.ksh success -> log into c.log d.ksh -> depends on c.ksh success -> log into d.log I will have to write main.ksh ( execute a.ksh , log into a.log if a.ksh= success, execute... (1 Reply)
Discussion started by: konark
1 Replies

4. Shell Programming and Scripting

not able to execute shell script

HI, bash-2.05# more mysqlstoporaclestart.sh #!/bin/sh mysqladmin -u root -pengineer shutdown su - oracle -c "bash /export/home/oracle/oracle.sh" bash-2.05# more /export/home/oracle/oracle.sh /oracle/bin/sqlplus "/as sysdba"<< EOF startup nomount... (2 Replies)
Discussion started by: prakash.gr
2 Replies

5. Shell Programming and Scripting

Execute unix shell script to text file using the script

Hi all, I am beginner in UNIX...I want to use unix shell script to create text.file...I know how to use using by command...can anybody tell me for the script? Thanks i changed the threads title from "tex file" to "text file", because "tex" would probably be misunderstood as reference to... (4 Replies)
Discussion started by: mastercar
4 Replies

6. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

7. UNIX for Dummies Questions & Answers

can't execute a shell script

Hi all, As i want to know how the shell command "nohup" worked.I logged in as the user named vincent through Gnome.Then i press ctrl+atl+F1 changed into a console and logged in as another user named kinsley.The user "kinsley" is added by me with "useradd",and now there's no HOME directory for... (6 Replies)
Discussion started by: homeboy
6 Replies

8. Shell Programming and Scripting

Dos batch script to execute unix shell script

Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh. Thanks in advance (2 Replies)
Discussion started by: Shri123
2 Replies

9. Shell Programming and Scripting

How to execute one shell script after execution of another shell script?

I have a master shell script master.sh which will invoke 2 shell scripts (test1.sh,test2.sh). Both of these shell scripts will execute stored procedure. I will invoke test1.sh, test2.sh respectively. Now both of these scripts are executing parallel. But i want to invoke the 2nd script(test2.sh)... (3 Replies)
Discussion started by: vel4ever
3 Replies

10. Shell Programming and Scripting

Batch script to execute shell script in UNIX server

Hi team, My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server. I have completed the first part i.e From windows to using to unix server with the help of psftp.exe code: psftp user@host -pw password <... (1 Reply)
Discussion started by: bhupeshchavan
1 Replies
cd(1)							      General Commands Manual							     cd(1)

NAME
cd - Changes the current working directory SYNOPSIS
cd [directory] Note The C shell has a built-in version of the cd command. If you are using the C shell, and want to guarantee that you are using the command described here, you must specify the full path /usr/bin/cd. See the csh(1) reference page for a description of the built-in command. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: cd: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
None OPERANDS
The pathname (either full or relative) to be used as the new working directory. If (hyphen) is specified as the directory, the cd command changes your current (working) directory to the directory name saved in the environment variable OLDPWD. DESCRIPTION
The cd command moves you from your present directory to another directory. You must have execute (search) permission in the specified directory. If you do not specify a directory, cd moves you to your login directory ($HOME in ksh and sh environments, or $home in csh environment). If the specified directory name is a full pathname, it becomes the current working directory. A full pathname begins with a / (slash) for the root directory, with a . (dot) for the current working directory, or with a .. (dot dot) for the parent directory. If the directory name is not a full pathname, cd searches for it relative to one of the paths specified by the $CDPATH shell variable (or $cdpath csh vari- able). This variable has the same syntax as, and similar semantics to, the $PATH shell variable (or $path csh variable). EXIT STATUS
The following exit values are returned: The directory was successfully changed. An error occurred. EXAMPLES
To change to your home directory, enter: cd To change to a new directory, enter: cd /usr/include This changes the current working directory to /usr/include. Now file pathnames that do not begin with / or ../ specify files located in /usr/include. To go down one level of the directory tree, enter: cd sys If the current working directory is /usr/include and if it contains a subdirectory named sys, then /usr/include/sys becomes the cur- rent working directory. To go up one level of the directory tree, enter: cd .. The special filename .. (dot dot) always refers to the directory immediately above the current working directory. ENVIRONMENT VARIABLES
The following environment variables affect the execution of cd: A colon-separated list of pathnames that refer to directories. If the directory operand does not begin with a / (slash) character, and the first component is not (dot) or cd command will search for directory relative to each directory named in the CDPATH variable, in the order listed. The new working directory will be set to the first matching directory found. An empty string in place of a directory pathname represents the current directory. If CDPATH is not set, it will be treated as if it were an empty string. The name of the home directory, used when no directory operand is specified. Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization variables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte char- acters in arguments). Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. A pathname of the previous working directory, used by the cd - form of the command. The cd command sets this variable to your current working directory before changing to a new current directory. A pathname of the current working directory, set by the cd command after it has changed to that directory. SEE ALSO
Commands: csh(1), ksh(1), pwd(1), Bourne shell sh(1b), POSIX shell sh(1p) Functions: chdir(2) Environment: environ(5) Standards: standards(5) cd(1)
All times are GMT -4. The time now is 11:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy