Search code examples
unixdirectorytcsh

Start tcsh in a specific directory


Does tcsh support launching itself in a remote directory via an argument?

The setup I am dealing with does not allow me to chdir to the remote directory before invoking tcsh, and I'd like to avoid having to create a .sh file for this workflow.

Here are the available arguments I see for v6.19:

> tcsh --help                                                                                          
tcsh 6.19.00 (Astron) 2015-05-21 (x86_64-unknown-Linux) options wide,nls,dl,al,kan,rh,color,filec                                                                  

-b file         batch mode, read and execute commands from 'file' 
-c command      run 'command' from next argument                  
-d              load directory stack from '~/.cshdirs'            
-Dname[=value]  define environment variable `name' to `value' (DomainOS only) 
-e              exit on any error
-f              start faster by ignoring the start-up file
-F              use fork() instead of vfork() when spawning (ConvexOS only)
-i              interactive, even when input is not from a terminal
-l              act as a login shell, must be the only option specified
-m              load the start-up file, whether or not owned by effective user
-n file         no execute mode, just check syntax of the following `file'
-q              accept SIGQUIT for running under a debugger
-s              read commands from standard input
-t              read one line from standard input
-v              echo commands after history substitution
-V              like -v but including commands read from the start-up file
-x              echo commands immediately before execution
-X              like -x but including commands read from the start-up file
--help          print this message and exit
--version       print the version shell variable and exit

Solution

  • This works, but is suboptimal because it launches two instances of tcsh:

    tcsh -c 'cd /tmp && tcsh'