05-26-2008
You can use pushd and popd.
ie:
pwd = /var/adm
if you type pushd /usr/local you will be in /usr/local
then if you type popd you will go back to /var/adm
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I'm trying to use the goto in ksh but it does not appear to be a valid command. Is that only valid in csh? Anything similar in ksh that I can use?
Appreciate any help you can provide.
Thanks.
geraldine (4 Replies)
Discussion started by: Geraldine
4 Replies
2. Shell Programming and Scripting
Is there a Unix (Solaris v8 ksh) version of the old basic command gosub or goto? I've researched the return command, but can't identify the command to return from. I am not trying to return from a function. Can someone give me a basic understanding of this please? Thanks so much in advance for... (3 Replies)
Discussion started by: gozer13
3 Replies
3. Shell Programming and Scripting
Hey Guys.. I just want to know how to use Goto statement in shell scripts.
I know the basic use of statement.
Goto Label
The above statement will search for some label which must be defined in the script itself as:
label:
I tried these combinations but I didn't work out for me and I'm... (7 Replies)
Discussion started by: vikasduhan
7 Replies
4. Shell Programming and Scripting
I have a test script for using goto statement but its not working. please help
i tried both in linux and hp-ux it's not working please help
#! /bin/ksh
t=`ps -ef|grep ti.sh|grep -v grep`
if ; then
goto start
else
goto stop
fi
start:
echo "start"
stop:
echo "stop" (5 Replies)
Discussion started by: Krrishv
5 Replies
5. UNIX for Dummies Questions & Answers
uname -a returns: SMP Tue May 17 17:52:23 EDT 2005 i686 athlon i386 GNU/Linux
I have many aliases beginning with "goto" so...
if I type goto and then hit return (oops)
A goto prompt pops up and I cant exit from it(I tried MANY key seqs)
The only way to exit is to kill the term window... (2 Replies)
Discussion started by: rairey
2 Replies
6. Shell Programming and Scripting
Im trying to do something like this but I cant find any documentation.
read X
if
then goto ThisLine
fi
OTHER CODE
OTHER CODE
Label: ThisLine echo "You entered 1" (5 Replies)
Discussion started by: Grizzly
5 Replies
7. Shell Programming and Scripting
Hi All,
I need your help in finding pattern from files present in different directories.
I need to search for a pattern "xyz" from "*.txt" files which are present in different levels of directories as shown.
example
-------
dir1/subdir1/file.txt
dir2/subdir2/subsubdir2/file.txt... (5 Replies)
Discussion started by: imas
5 Replies
8. Shell Programming and Scripting
#!/bin/sh
label:
echo sql poll
v=`sqlplus -s <<!
HR/HR
set pages 0 echo off feed off
select distinct status from
emp
where
id=5;
!
`
echo $v;
echo it comes here after false
if
then
echo if condition true
sqlplus -l scott/tiger <<EOF
select * from department;
EXIT (2 Replies)
Discussion started by: kumaar1986
2 Replies
9. Ubuntu
I have found many source files in the kernel using goto keyword instead of just doing the actual thing. For example:
if(blah)
goto x;
--
--
--
--
--
x: return blah-blah
Is there any specific reason for writing the code like this? The first thought that came to my mind is minimizing... (0 Replies)
Discussion started by: BHASKAR JUPUDI
0 Replies
10. Shell Programming and Scripting
Well, guys I saw a question about GOTO for Python.
So this gave me the inspiration to attempt a GOTO function for 'dash', (bash and ksh too).
Machine: MBP OSX 10.14.3, default bash terminal, calling '#!/usr/local/bin/dash'...
This is purely a fun project to see if it is possible in PURE... (3 Replies)
Discussion started by: wisecracker
3 Replies
LEARN ABOUT OSF1
wtmpconvert
wtmpconvert(8) System Manager's Manual wtmpconvert(8)
NAME
wtmpconvert - Modify connect time accounting records from DIGITAL UNIX releases 4.0x and prior to new format
SYNOPSIS
/usr/lbin/wtmpconvert [-vnrp?h] input_file [output_file]
OPTIONS
Restore new format to old format. Verbose. Display lines while converting. Do not preserve contents of input file. Formatted print only.
Do not convert. (May be used with the -r option). Display usage message.
DESCRIPTION
The wtmpconvert command reads records from a connect time accounting file, such as /var/adm/wtmp, and converts the record format to the
updated struct utmp format. If no output file is specified or if the output file path is identical to the input file path, wtmpconvert
makes a backup copy of the original input file using the following algorithm: If filename.orig exists. Where n is a unique number.
The wtmpconvert command attempts to detect an input file that is in the wrong format (for example, input file is already a new format
file). A warning message is issued in this case, but conversion continues.
EXIT STATUS
Success. An error occurred.
EXAMPLES
To convert an old format accounting file to the new format: wtmpconvert /var/adm/wtmp.prev
Upon completion of this command, /var/adm/wtmp.prev will have been converted to the new format. The original /var/adm/wtmp.prev is
renamed to /var/adm/wtmp.prev.orig. To convert a wtmp file in new format to the old format: wtmpconvert -r /var/adm/wtmp
/var/adm/wtmp.old
FILES
Accounting header files that define the format for the login database file. The active login/logoff database files.
SEE ALSO
Commands: acct(8), acctcon(8), acctmerg(8), date(1), runacct(8)
Functions: getutent(3)
Files: utmp(4), wtmp(4)
wtmpconvert(8)