Sponsored Content
Top Forums UNIX for Dummies Questions & Answers changing directories (i'm sure there is a simple solution for this) Post 16306 by Shakey21 on Wednesday 27th of February 2002 11:57:13 PM
Old 02-28-2002
changing directories (i'm sure there is a simple solution for this)

I just want to exit my script in a new directory from a bash shell. Problem is that the script internally changes to the directory I want to move to, however when exits is still in the original directory. Does that make sense?

ie usage: goto null

changing from /usr/bin/xtra/test/test3/

will move to /usr/bin/null/test/test3/


#!/usr/bin/sh
#goto
current_directory=`pwd | cut -f 4 -d "/"`
new_directory=`pwd | sed s=$current_directory=$1=`
cd $new_directory

Help is appreciated. Thanks!
Shakey21
 

10 More Discussions You Might Find Interesting

1. Programming

a very simple question (but i don't know)

how to write a program that receive a string from keyboard and then print it out. i write a program: main() { char str; gets(str); printf(str); } but when i compile it, the system said something like "new line is not last charicter" and sometime the system said "a3.c is up to date"... (1 Reply)
Discussion started by: dell9
1 Replies

2. UNIX for Dummies Questions & Answers

list file's by size order in sepecfied directory and sub directories

How do I list files of type "*.file" for example by size order recursively ? (2 Replies)
Discussion started by: ferretman
2 Replies

3. Programming

may be simple but i don't know -- Print current date from C program

How to print current date of the Unix system accessing thru C++ program ? I wrote like this #include <time.h> ....... time_t tt; struct tm *tod; .... time(&tt); tod = localtime(&tt); cout << tod->tm_mon + 1 << "/" << tod->tm_mday << "/" ... (6 Replies)
Discussion started by: ls1429
6 Replies

4. Shell Programming and Scripting

Clearify what it means under 'WHAT' when hit the 'w'-command

I wonder how I shall read the result below, especially 'what' shown below. The result was shown when I entered 'w'. E.g what is TOP? What is gosh ( what does selmgr mean?)? login@ idle JCPU PCPU what 6:15am 7:04 39 39 TOP 6:34am 6:45 45 45 TOP 6:41am ... (1 Reply)
Discussion started by: Aelgen
1 Replies

5. UNIX for Dummies Questions & Answers

Changing IP's

How do you change an IP address of an interface. (2 Replies)
Discussion started by: Hordak
2 Replies

6. Shell Programming and Scripting

Alias's & Functions - simple question

Having a memory lapse: If I redefine a command using an alias or a function - How do I access the "real" command without specifying an absoulte path: i.e. function man { /usr/bin/man |more } alias ls='/usr/bin/ls -l' How do I specify the ls or man command above without the... (6 Replies)
Discussion started by: kornshellmaven
6 Replies

7. UNIX for Dummies Questions & Answers

here's how i did a very simple install of invidia drivers

ok i got the nvida drivers for mandrake9 rpm there is 3 rpms you must have glx ,kernel and something else email me if you want the precompiled drivers :: email removed :: once i got the drivers in stalled then i reseted the computer then i put the 1cd of mandrake9 in and did a upgrade i... (2 Replies)
Discussion started by: amicrawler2000
2 Replies

8. UNIX for Advanced & Expert Users

How to remove a file with a leading dash '-' in it's name?

Somehow someone created a file named '-ov' in the root directory. Given the name, the how was probably the result of some cpio command they bozo'ed. I've tried a number of different ways to get rid of it using * and ? wildcards, '\' escape patterns etc.. They all fail with " illegal option --... (3 Replies)
Discussion started by: GSalisbury
3 Replies

9. Shell Programming and Scripting

What are the differences between 'bash' and 'sh'

Hopefully this doesn't come off as too much of a "newbie" question or a flamebait. But I have recently begun working with a Sun Solaris box after having spent the past five years working with RedHat. From what i can tell, thing look fairly similar and the 'man' command is some help. But I've... (7 Replies)
Discussion started by: deckard
7 Replies

10. Shell Programming and Scripting

Urgent solution for simple sed

Hi Im running this command on AIX in ksh. My input file samp1 contains 1 2 123 12345 When I execute the following sed i dont get a matching pattern sed -n '/{1}/p' samp1 Can anyone help me with this simple thing (3 Replies)
Discussion started by: raghav288
3 Replies
LDAP2TINYDNS-CONF(1)					      General Commands Manual					      LDAP2TINYDNS-CONF(1)

NAME
ldap2tinydns-conf - part of the ldap2dns DNS management system SYNOPSIS
ldap2tinydns-conf DESCRIPTION
This manual page documents briefly the ldap2tinydns-conf command. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page yet. ldap2tinydns-conf is a shell script to help configure ldap2dns for use with tinydns. This script wil add the directory structure and files required to run ldap2dns under daemontools. Run this script within your tinydns directory. For example: root@host[/var/tinydns]# ldap2tinydns-conf This creates the ldap2tinydns directory under your tinydns directory and adds the default configuration under ldap2tinydns/env. OPTIONS
This shell script does not take any commanline options. SEE ALSO
tinydns, ldap2dns(1). Please visit the project homepage for more detail: [http://ldap2dns.tiscover.com/] AUTHOR
This manual page was written by Johann Botha <joe@blio.net>, for the Debian GNU/Linux system and is distributed under the GPL version 2 or later. Jacob Rief <jacob.rief@tiscover.com> is the original author of this program.. June 7, 2001 LDAP2TINYDNS-CONF(1)
All times are GMT -4. The time now is 06:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy