Re: Special parameter $_ expands to a relative path

2011-09-01 Thread Angel Tsankov
rtainly a pain in the ass. Regards, Angel Tsankov

Special parameter $_ expands to a relative path

2011-08-31 Thread Angel Tsankov
, version 3.2.39 a simple script (named 'a'): #!/bin/bash echo "$_" prints './a' when invoked as './a'. According to the above excerpt, should it not print an absolute path to 'a' instead? Regards, Angel Tsankov

Testing standard output and exit statuses from commands in a pipe

2009-04-27 Thread Angel Tsankov
Hello! I'd like to pipe the output from a command, say A, to another command, say B, then check if both commands completed successfully (i.e.with exist status 0) and, if so, compare the standard output from command B to some string. How can I do this in a bash script? Regards, Angel Tsankov

Re: Creating directories with sticky bit set

2009-03-12 Thread Angel Tsankov
7;d want to process function arguments, and remove for > example a "-p" option before passing them along to chmod. I'll leave > that part as an exercise.) > Let's say that removing '-p' is straightforward, but what about setting the sticky bit to every newly created directory component? Regards, Angel Tsankov

Creating directories with sticky bit set

2009-03-12 Thread Angel Tsankov
Hello, What can I do so that every directory I create has the sticky bit set? Regards, Angel Tsankov

Program to search unusual strings?

2009-03-11 Thread Angel Tsankov
Hi, Which program can be used to search for line-feed characters in a string that might contain null characters? Regards, Angel Tsankov

IFS valid characters

2009-03-10 Thread Angel Tsankov
Hi, What are the valid charactes for the IFS variable? In particular, is '\0' a valid one?

Re: Passing paths with spaces from one command to another

2009-03-10 Thread Angel Tsankov
What if the second command is a function defiend in a shell script, or a bash built-in command?

Passing paths with spaces from one command to another

2009-03-10 Thread Angel Tsankov
Hello, I want to pass the output from one command (e.g. find) to some other command so that each path (output by the first command) gets into a distinct positional parameter of the second command. How can I do this if some paths contain spaces?

Re: No tilde expansion right after a quotation

2009-02-16 Thread Angel Tsankov
Dave B wrote: > Angel Tsankov wrote: >> Eric, thanks for youy replay. If double quotes are not that >> portable, then how am I suppose to assign the output from some >> command to a variable when the output contains a space? > > Word splitting doesn't happen on a

Re: No tilde expansion right after a quotation

2009-02-16 Thread Angel Tsankov
Eric Blake wrote: > According to Angel Tsankov on 2/15/2009 3:02 PM: >> I tried CPATH="${CPATH}${CPATH:+:}"~usr1/blah/blah. (I quote >> expansions just to be on the safe side, though I think home >> directories may not contain spaces.) > > There are some c

Re: No tilde expansion right after a quotation

2009-02-15 Thread Angel Tsankov
Paul Jarc wrote: > Jon Seymour wrote: >> On Mon, Feb 16, 2009 at 10:22 AM, Paul Jarc wrote: >>> CPATH=${CPATH:+$CPATH:}${#+~usr1/blah/blah} >> >> Out of interest, how does one derive that outcome from the documented >> behaviour of bash? That is, which expansion rules are being invoked? > > It's

Re: No tilde expansion right after a quotation

2009-02-15 Thread Angel Tsankov
Jon Seymour wrote: > On Mon, Feb 16, 2009 at 10:22 AM, Paul Jarc wrote: >> Jon Seymour wrote: >>> If the builtin echo fails it will be because the bash interpreter >>> has suffered a catastrophic failure of some kind [ e.g. run out of >>> memory ]. Once that has happened, all bets are off anyway.

Re: No tilde expansion right after a quotation

2009-02-15 Thread Angel Tsankov
Paul Jarc wrote: > Jon Seymour wrote: >> If the builtin echo fails it will be because the bash interpreter has >> suffered a catastrophic failure of some kind [ e.g. run out of memory >> ]. Once that has happened, all bets are off anyway. > > Probably true, but command substitution forks a separat

Re: No tilde expansion right after a quotation

2009-02-15 Thread Angel Tsankov
echo ~usr1/blah/blah) on aesthetic grounds too - I welcome any > suggested improvement!. ] > > jon. Thanks for your replies, Angel Tsankov

Re: No tilde expansion right after a quotation

2009-02-15 Thread Angel Tsankov
Jon Seymour wrote: > On Mon, Feb 16, 2009 at 9:26 AM, Angel Tsankov > wrote: >> Jon Seymour wrote: >>> There may be other ways to do this, but: >>> >>> CPATH="${CPATH}${CPATH:+:}$(echo ~usr1/blah/blah)" >>> >>> shou

Re: No tilde expansion right after a quotation

2009-02-15 Thread Angel Tsankov
Jon Seymour wrote: > There may be other ways to do this, but: > > CPATH="${CPATH}${CPATH:+:}$(echo ~usr1/blah/blah)" > > should work. Well, I'd like to avoid the use of external commands. --Angel

Re: No tilde expansion right after a quotation

2009-02-15 Thread Angel Tsankov
Chet Ramey wrote: > Angel Tsankov wrote: >> Hi, >> >> Using bash 3.2.48(1)-release, echo ""~root prints ~root instead of >> /root. Is this the expected behaviour? > > Yes. The tilde is not the first character in the word. Portions of > words to be

No tilde expansion right after a quotation

2009-02-15 Thread Angel Tsankov
Hi, Using bash 3.2.48(1)-release, echo ""~root prints ~root instead of /root. Is this the expected behaviour? Angel Tsankov