Axel Liljencrantz wrote:
> I hadn't really though about the issue of using pwd in scripts,
> though. I would say that is a good enough reason to scrap the use of
> ~. One possibility is to use ~ only if stdout is a terminal, much like
> e.g. ls does with --color=auto, or how the mysql client behaves by
> default. Opinions are welcome.
>
> For now, if you want to disable the use of ~, cut and paste the
> following code into the commandline:
>
> function pwd
> echo $PWD
> end
> save_function pwd
I ended up using $PWD in that script, but this issue is a 'gotcha' when
porting from sh/bash. Maybe documenting it is enough.
The problem with detecting the terminal and doing something different is
that it is hidden and non-obvious behaviour, which makes debugging
scripts frustrating ("why does it work in my terminal but breaks in my
script?? it's the same [EMAIL PROTECTED]"), and breaks the idea that scripts
are
just the same as the command line, except longer and spanning multiple
lines.
cheers,
--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
[EMAIL PROTECTED] | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users