starting bash in a directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers starting bash in a directory
# 1  
Old 10-22-2009
starting bash in a directory

I wish to start bash in a directory at a per invocation basis. i.e, this has nothing to do with a user's home directory.

In my program, I should be able to give: "bash "/lib/examples" in one place and
bash "/lib/src" in another. A shell would start in that folder for me to work in.

This requirement actually comes from my .screenrc file where i can make multiple calls to screen to open differernt shells. However I need to open them in different folders.
Quote:
screen -t example -h 0 2 bash
Here I should be able to pass an arg to bash to start in a folder.
# 2  
Old 10-22-2009
write a script called example

cd /lib/examples
bash

change
screen -t example -h 0 2 example

add or change the PATH statement as required.
# 3  
Old 10-23-2009
MySQL

Thanks jgt.
That has occured to me as a last resort.
I am still hoping for an in-line answer. Until then I'll use this one.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash find with expression - process all files except the starting-points

Hello. This command is correct : find /home/user_install \( \ \( -type d \( -iname "*firefox*" -o -iname ".cache" -o -iname "libreoffice" \ -o -iname "session" -o -wholename "/home/user_install/dir1/dir2/¬¬ICONS_WALLPAPERS_THEMES" \) \) -prune -o \ \( -type f \( -iname... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Create directory and sub-directory with awk and bash

In the below I am trying to create a parent directory using the R_2019 line from f1 if what above it is not empty. I then create sub-directories under each parent if there is a match between $2 of f1 and $2. Inside each sub-folder the matching paths in $3 and $4 in f2are printed. If there is no... (2 Replies)
Discussion started by: cmccabe
2 Replies

3. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

4. Shell Programming and Scripting

With script bash, read file line per line starting at the end

Hello, I'm works on Ubuntu server My goal : I would like to read file line per line, but i want to started at the end of file. Currently, I use instructions : while read line; do COMMAND done < /var/log/apache2/access.log But, the first line, i don't want this. The file is long... (5 Replies)
Discussion started by: Fuziion
5 Replies

5. Red Hat

Httpd service not starting... Error "Documentroot must be a directory"

I am working with CentOS 6.5. Indeed the document root /var/www/html is a directory and it is a mount point of one file system (not NFS) I observed, if I unmount that file system, I could able to start httpd. Is it restricted in CentOS 6.X that the Documentroot can not be a mount point? ... (5 Replies)
Discussion started by: atanubanerji
5 Replies

6. UNIX for Dummies Questions & Answers

Printing directory starting from a particular folder

Hi there!:o I have a question if I have a directories ~/MyFolder/Files/PersonalFiles/databases/food/tomato ~/MyFolder/Files/PersonalFiles/databases/items/cup and I want my program to output food/tomato and items/cup, i.e. everything from the folder database but without... (5 Replies)
Discussion started by: FUTURE_EINSTEIN
5 Replies

7. Shell Programming and Scripting

How to count the number of files starting with a pattern in a Directory

Hi! In our current directory there are around 35000 files. Out of these a few thousands(around 20000) start with, "testfiles9842323879838". I want to count the number of files that have filenames starting with the above pattern. Please help me with the command i could use. Thank... (7 Replies)
Discussion started by: atechcorp
7 Replies

8. Shell Programming and Scripting

Bash: How to get part of the directory name?

How can I write a script that determines the directory the user is in, and displays that path up until a particular point? Specifically, I need to find the text "packages" in the directory name, then I need to capture that directory and the one below it. For example, if the user is in the... (5 Replies)
Discussion started by: RickS
5 Replies

9. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know. More detail. ScriptA (bash), ScriptB (ksh), ScriptC (bash) ScriptA, launches ScriptB ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies

10. Shell Programming and Scripting

starting a bash session as child process to another bash session from a process

Hi I want to do something that might sound strange. I have a code that in written in C and is executed at startup (it's a custom process). It occasionally calls some bash scripts. The process doesn't have any terminal associated with it. One thing I don't know how to do is to start a... (5 Replies)
Discussion started by: alirezan
5 Replies
Login or Register to Ask a Question