pwd: A specified flag is not valid for this command.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers pwd: A specified flag is not valid for this command.
# 1  
Old 08-29-2003
pwd: A specified flag is not valid for this command.

Probably a very straight forward question but please be easy on me, I am v. new to UNIX!

A script that I have runs the line

tmp=`pwd -H`

It works fine, but I needed to make a couple of other changes to the script, nowhere near this line but now this line reports:

pwd: A specified flag is not valid for this command.

When I use the original script again there is no problem at all.

Any ideas as to what may be causing this.

Cheers
# 2  
Old 08-29-2003
What O.S. / shell do you use?
uname -a
echo $SHELL

I've never seen an H option for pwd.. only L and P.

Does the top of the script say anything like /bin/sh or anything like that?

Are there any other instances of pwd anywhere in the script?
# 3  
Old 08-29-2003
Actually I kinda think that I have seen a -H option to pwd, but I'm not completely sure and I can't find any evidence of it. Still, my feeling is that -H meant hard and there was a -S which meant soft or symbolic, with -S being the default. If this is right, the -H would now be -P or a Posix compliant system. For pwd to be able to distingish between a physical and a logical path it must be a shell built-in. So the -H would be specific to some shell that I came across sometime after symbolic links were invented and before Posix standardized the pwd options.

And there is another possibility... circa 1980, pwd was not built-in to the shell. The shell had to invoke a separate program to run pwd. That program ignored its arguments. The SunOs /usr/bin/pwd seems to still behave like that. If this is very old script, the -H could be an error that seemed to work when the script ran with an older shell.

In any event, the change being made to the script is possibly triggering the execution of that pwd line. And prior to the change, the script didn't happen to reach that path.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Command Understanding :- . $PWD/.profile

Hi, I am new in unix, can anyone please explain the use of:- . $PWD/.profile Thanks, Sujoy (5 Replies)
Discussion started by: sujoyrchowdhury
5 Replies

2. Shell Programming and Scripting

Help with 'pwd' command

Dear all, I am trying to use 'pwd' command in following way. current_directory == /dirA/dirB/test/dirC if ; then do this fi I am not sure how to pass this in command way. Please help! thanking you, emily (10 Replies)
Discussion started by: emily
10 Replies

3. Shell Programming and Scripting

Behaviour of pwd command in sh and ksh

I have a script as below. bash-3.00$ cat test.sh #!/usr/bin/ksh path=`pwd` echo $path var=$path/temp11 echo $var If run it is giving output bash-3.00$ ksh test.sh //var/tmp/SB2/miscellaneous //var/tmp/SB2/miscellaneous/temp11 (5 Replies)
Discussion started by: millan
5 Replies

4. Shell Programming and Scripting

Making use of PWD command in the code

Hi all, Need some help in the following code. (Running this code at cygwin in windows vista) cat /home/ebanpan/Input_Logs/*.log > /home/ebanpan/Input_Logs/input.log sed '/^Total/d;/^Bye/d;/^Output has been logged/d' /home/ebanpan/Input_Logs/input.log > /home/ebanpan/output.log this code... (6 Replies)
Discussion started by: bansalpankaj88
6 Replies

5. AIX

sync samba pwd with aix5.3 pwd

currently, my samba login works just fine. i want my clients to use aix5.3 account to login to samba so they don't have to change samba pwd and aix pwd. i googled, and vi /usr/lib/smb.conf per some of knowledge base, but i could not get to work. aix5.3 and samba 3.0.24.0 thanks in advace..... (2 Replies)
Discussion started by: tjmannonline
2 Replies

6. UNIX for Dummies Questions & Answers

PWD COMMAND

Hi, Can you tell me if there is a command such as pwd which does not give me the absolute NFS pathname i.e. it starts with .autofs? At the moment on the unix when I use the 'pwd' command it always gives me the nfs pathname rather thanthe local pathname of which is what i want, is there an... (4 Replies)
Discussion started by: cyberfrog
4 Replies

7. UNIX for Dummies Questions & Answers

COMMAND sed AND pwd

Hi, I should replace the string DIR_ZERO in the file FILE_OLD with the current directory path in FILE_NEW by using something like this: sed "s/DIR_ZERO/'$(pwd)'/" FILE_OLD > FILE_NEW but it doesn't work and I don't understand why...:confused: Thanks in advance!!! Giordano Bruno (2 Replies)
Discussion started by: Giordano Bruno
2 Replies

8. Shell Programming and Scripting

the flag -c in sh command

I need your help please. In a production system, i've seen many running process as follow: sh -c ./pathname/shellname what exactly the flag option -c is used for? ive tried to look at the man page, but it doesnt say much. ill appreciate yor help. Thanks (4 Replies)
Discussion started by: alexcol
4 Replies

9. IP Networking

Enable PWD command on anonymous FTP?

Hello everyone - First post here, I'm trying to connect to an anonymous ftp server and I am told by the server admin that I cannot have access to the "print working directory" command. I need to have access to this command in order for my (and my clients) preferred ftp client to connect. (the... (9 Replies)
Discussion started by: HiredGun79
9 Replies

10. UNIX for Dummies Questions & Answers

pwd Command and NIS mount points

I am running NIS, NFS and automount. If I execute % cd /xyz/data1 % pwd I get different results depending on the operating system. On SGI running Irix 6.5.x pwd returns /xyz/data1 On Redhat Linux 7.3 pwd returns /xyz/data1 BUT On Tru64 UNIX the pwd command returns... (1 Reply)
Discussion started by: agreenwo
1 Replies
Login or Register to Ask a Question