Sponsored Content
Top Forums Shell Programming and Scripting Doubt on Executing unix commands in script Post 302075615 by System Shock on Monday 5th of June 2006 07:49:53 PM
Old 06-05-2006
If you want to see which directory you cd'd to in your command prompt, add the following to your .profile (or in /etc/profile for everyone) :

Code:
PS1='$PWD" # "'

So if you are in your home directory, you'll see:

/home/naresh #

and you cd to unixinfo, your prompt will change to:

/home/naresh/unixinfo #

Note: this command form works in ksh (my shell of preference for over a decade) . If you are using another shell, the syntax may be different or not work.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix + oracle doubt....involving shell script

....does the dbms_output.put_line work inside unix shell script? i mean this is to be inside the sqlplus connection as follows!! sqlplus -s $UP <<EOJ .. .. .. dbms_output.put_line ('Insertion procedure failed for UPC BC : ' || wk_key_value || ' Sqlcode: ' || SQLCODE || ' Error... (2 Replies)
Discussion started by: mexx_freedom
2 Replies

2. UNIX for Advanced & Expert Users

executing applications/commands on a unix server from a windows PC

i have a network drive (samba) mounted on to my PC and also i have SSH client on my machine. however i need to run applications/commands on a unix server from the middle of a different executable(windows compatable one). so i need to connect to the unix server from SSH through the... (1 Reply)
Discussion started by: megastar
1 Replies

3. Shell Programming and Scripting

Executing TL1 commands through script

HI , I have to write a script for some testing , which will telnet to a device and execute some TL1 commands.. Does any one knows how to execute TL1 commands through a script Thanks in advance Binu (1 Reply)
Discussion started by: msbinu
1 Replies

4. UNIX for Dummies Questions & Answers

Sending a mail from unix script doubt

HI i usually send an a file attachment in a mail from unix like following. mailx -s 'Job Success' someoner@gmail.com < attachment.log But I have observed in several threads that we can also use uuencode and uudecode. What are they? when should we use uudecode and uuencode ... (1 Reply)
Discussion started by: rajesh_tns
1 Replies

5. UNIX for Advanced & Expert Users

Executing a shell script from windows;script present in unix

I need to execute a shell script kept in unix machine from windows. User id, password area available. For eg. There's a shell script wich moves all the logs kept in my home directory to a directory named LOGS. Now i need to get this done through windows; either using a batch file, or java... (4 Replies)
Discussion started by: rajneesh_kapoor
4 Replies

6. Shell Programming and Scripting

Executing a shell script containing awk commands

Hi All, I am trying to execute a shell script containg awk commands. But unable to do so. Below is my script. Please help. The name of the script is scan.sh and I have tried executing it using the command sh scan.sh It is giving an error which reads like: awk:syntax error near line 7... (3 Replies)
Discussion started by: misb
3 Replies

7. Shell Programming and Scripting

Executing mutliple commands in Unix

Hi I always do a ftp in Unix to bring in a file from Mainframes. Then run a set of commands say 8 commands one by one to execute the brought in file. Upon completion of this commands, the data from the file gets transfered to Mainframe database. The problem is i can execute only 1 file at a time.... (2 Replies)
Discussion started by: cnelatur
2 Replies

8. Shell Programming and Scripting

Doubt in getopts commands

I am new to getopts command. I wonder the if there is any built in way to detect that if both options occurred from where only on them is expected. command Correct command -a command -b Incorrect command -a -b command -ab Please clarify my doubt. (5 Replies)
Discussion started by: tamil.pamaran
5 Replies

9. Shell Programming and Scripting

Commands not executing after FTP in shell script

Hello In the shell script we have a FTP command like below ftp -n -v -q winftp.principal.com >/infa/datafiles/GRP/Scripts/ftp_from_infa_dvcn.log<<END_SCRIPT   quote USER $FTP_USER quote PASS $FTP_PASS ascii lcd $FTP_LOCALDIR cd $FTP_FLDR put $FTP_FILE   bye exit If i... (1 Reply)
Discussion started by: Pratik4891
1 Replies

10. Shell Programming and Scripting

scp Commands not executing via cgi script

Hi, I have a CGI script, which includes a python custom header file. The cgi script calls a few functions. Py file. #resourcemanager creation def make_rm(rmip,nip,nport): fp = open("temp1.txt",mode="w") fp.write('<?xml version="1.0"?>\n<!-- Licensed under the Apache... (2 Replies)
Discussion started by: adi.6194
2 Replies
INSTALL-MH(8)							     [nmh-1.5]							     INSTALL-MH(8)

NAME
install-mh - initialize the nmh environment SYNOPSIS
/usr/lib/mh/install-mh [-auto] [-check] [-version] [-help] DESCRIPTION
Install-mh is the nmh program to create the initial setup for a first-time nmh user. Install-mh lives in two places for historical rea- sons. The -auto option does things as automatically as possible and makes install-mh less chatty. The user is asked for the name of the directory that will be designated as the user's nmh directory. If this directory does not exist, the user is asked if it should be created. Normally, this directory should be under the user's home directory, and has the default name of ``Mail''. Install-mh writes an initial .mh_profile for the user. As with all nmh commands, install-mh first checks for the existence of the $MH environment variable since that gives the profile path if set. If it isn't set, the $HOME environment variable is consulted to determine the user's home directory. If $HOME is not set, then the /etc/passwd file is consulted. When creating the users initial .mh_profile, install-mh will check for the existence of a global profile /etc/nmh/mh.profile. If found, this will be used to initialize the new .mh_profile. The -check option can be used to check whether or not nmh has been installed. This can be used by other programs to determine whether or not nmh has been installed without their having to know the internals of nmh. FILES
$HOME/.mh_profile The user profile /etc/nmh/mh.profile Used to initialize user profile PROFILE COMPONENTS
Path: To set the user's nmh directory CONTEXT
With -auto, the current folder is changed to "inbox". MH.6.8 11 June 2012 INSTALL-MH(8)
All times are GMT -4. The time now is 08:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy