f



[why are trailing '\n's missing in "$x"]: x="$(printf "hi\n\n")"; printf "$x"

Ex
  
  ~ $ printf "hi\n\n"|cat -A
  hi$
  $
  ~ $ x="$(printf "hi\n\n")"
  ~ $ printf "$x"|cat -A
  hi~ $

Why are the trailing '\n's not in "$x"?  Is there any way to stop this,
w/o using a tempfile?

--
thanks!

0
anonb6e9
12/29/2013 10:34:45 PM
comp.unix.shell 15484 articles. 2 followers. Post Follow

14 Replies
737 Views

Similar Articles

[PageSpeed] 34

On 12/29/2013 11:34 PM, Name withheld by request wrote:
> x="$(printf "hi\n\n")"

x="$(printf "%s" "hi\n\n")"

Best regards,
Cyrus
0
Cyrus
12/29/2013 10:56:05 PM
In article <bibnk6Ftcm6U1@mid.individual.net>,
Cyrus Kriticos  <cyrus.kriticos@googlemail.com> wrote:
>On 12/29/2013 11:34 PM, Name withheld by request wrote:
>> x="$(printf "hi\n\n")"
>
>x="$(printf "%s" "hi\n\n")"
>
>Best regards,
>Cyrus

Which is, at best, a pedantic nitpick, having nothing to do with OP's
problem.

In fact, ITYM:

x="$(printf "%s\n\n" "hi")"

(which still doesn't solve OP's problem, but at least demonstrates better
pedantry)

-- 
Watching ConservaLoons playing with statistics and facts is like watching a
newborn play with a computer.  Endlessly amusing, but totally unproductive.
0
gazelle
12/29/2013 11:00:46 PM
On 12/30/2013 12:00 AM, Kenny McCormack wrote:
> In article <bibnk6Ftcm6U1@mid.individual.net>,
> Cyrus Kriticos  <cyrus.kriticos@googlemail.com> wrote:
>> On 12/29/2013 11:34 PM, Name withheld by request wrote:
>>> x="$(printf "hi\n\n")"
>>
>> x="$(printf "%s" "hi\n\n")"
>>
>> Best regards,
>> Cyrus
>
> Which is, at best, a pedantic nitpick, having nothing to do with OP's
> problem.
>
> In fact, ITYM:
>
> x="$(printf "%s\n\n" "hi")"
>
> (which still doesn't solve OP's problem, but at least demonstrates better
> pedantry)
>

You are right with the syntax. Both solve the problem with a bash.

Best regards,
Cyrus
0
Cyrus
12/29/2013 11:14:53 PM
On Mon, 30 Dec 2013 00:14:53 +0100, Cyrus Kriticos
<cyrus.kriticos@googlemail.com> wrote:

> On 12/30/2013 12:00 AM, Kenny McCormack wrote:
> > In article <bibnk6Ftcm6U1@mid.individual.net>,
> > Cyrus Kriticos  <cyrus.kriticos@googlemail.com> wrote:
> >> On 12/29/2013 11:34 PM, Name withheld by request wrote:
> >>> x="$(printf "hi\n\n")"
> >>
> >> x="$(printf "%s" "hi\n\n")"
> >>
> >> Best regards,
> >> Cyrus
> >
> > Which is, at best, a pedantic nitpick, having nothing to do with OP's
> > problem.
> >
> > In fact, ITYM:
> >
> > x="$(printf "%s\n\n" "hi")"
> >
> > (which still doesn't solve OP's problem, but at least demonstrates
> > better pedantry)
> >
> 
> You are right with the syntax. Both solve the problem with a bash.
> 
> Best regards,
> Cyrus

None solve the problem, this does:

x=$(printf "%s\n\nx" "hi")
x=${x%x}
0
pk
12/29/2013 11:24:01 PM
On Mon, 30 Dec 2013 00:24:01 +0100, pk <pk@pk.invalid> wrote:

> x=$(printf "%s\n\nx" "hi")
> x=${x%x}

In a form easier to reuse for any generic command substitution:

x=$(printf "%s\n\n" "hi"; echo x)
x=${x%x}
0
pk
12/29/2013 11:33:55 PM
On 29.12.2013 23:34, Name withheld by request wrote:
> Ex
>   
>   ~ $ printf "hi\n\n"|cat -A
>   hi$
>   $
>   ~ $ x="$(printf "hi\n\n")"
>   ~ $ printf "$x"|cat -A
>   hi~ $
> 
> Why are the trailing '\n's not in "$x"?  Is there any way to stop this,
> w/o using a tempfile?

$ x=$'hi\n\n'
$ printf "$x" | cat -A
hi$
$


Janis

> 
> --
> thanks!
> 

0
Janis
12/29/2013 11:37:21 PM
On 12/30/2013 12:24 AM, pk wrote:
> On Mon, 30 Dec 2013 00:14:53 +0100, Cyrus Kriticos
> <cyrus.kriticos@googlemail.com> wrote:
>
>> On 12/30/2013 12:00 AM, Kenny McCormack wrote:
>>> In article <bibnk6Ftcm6U1@mid.individual.net>,
>>> Cyrus Kriticos  <cyrus.kriticos@googlemail.com> wrote:
>>>> On 12/29/2013 11:34 PM, Name withheld by request wrote:
>>>>> x="$(printf "hi\n\n")"
>>>>
>>>> x="$(printf "%s" "hi\n\n")"
>>>>
>>>> Best regards,
>>>> Cyrus
>>>
>>> Which is, at best, a pedantic nitpick, having nothing to do with OP's
>>> problem.
>>>
>>> In fact, ITYM:
>>>
>>> x="$(printf "%s\n\n" "hi")"
>>>
>>> (which still doesn't solve OP's problem, but at least demonstrates
>>> better pedantry)
>>>
>>
>> You are right with the syntax. Both solve the problem with a bash.
>>
>> Best regards,
>> Cyrus
>
> None solve the problem [...]

No.

$ x="$(printf "%s" "hi\n\n")"
$ printf "$x"|cat -A
hi$
$

It works fine.

Best regards,
Cyrus
0
Cyrus
12/30/2013 12:02:32 AM
anonb6e9@nyx.net (Name withheld by request) writes:

> Ex
>   
>   ~ $ printf "hi\n\n"|cat -A
>   hi$
>   $
>   ~ $ x="$(printf "hi\n\n")"
>   ~ $ printf "$x"|cat -A
>   hi~ $
>
> Why are the trailing '\n's not in "$x"?  Is there any way to stop this,
> w/o using a tempfile?

Within the $() construct above, pls consider
  printf "hi\n\n"
fixed, ie a given.
It's ok to filter it's output as in x="$(printf "hi\n\n" |FILTERHERE)".

In my real problem the output comes from a perl script instead of the
printf, and the number of trailing '\n's is *unknown*.

I'm curious why the shell is stripping the \012 chars, and only at the
end.  I tried removing '\n' from IFS and OFS.

I thought you could:

  x="$(cat ./foo)"

and be assured that

  echo "$x"|md5sum
  md5sum ./foo

would be identical. Try for example:

  md5sum  <(tail -2 /etc/group) <(printf "$(tail -2 /etc/group)")

Are there any other cases other than the trailing '\n's where
  x="$(cat ./foo)"
will not agree w/contents of file ./foo?

--
thanks
0
Am
12/30/2013 1:33:36 AM
On 30.12.2013 02:33, Am Nym wrote:
> anonb6e9@nyx.net (Name withheld by request) writes:

Are you and the OP the same poster?

> 
>> Ex
>>   
>>   ~ $ printf "hi\n\n"|cat -A
>>   hi$
>>   $
>>   ~ $ x="$(printf "hi\n\n")"
>>   ~ $ printf "$x"|cat -A
>>   hi~ $
>>
>> Why are the trailing '\n's not in "$x"?  Is there any way to stop this,
>> w/o using a tempfile?
> 
> Within the $() construct above, pls consider
>   printf "hi\n\n"
> fixed, ie a given.
> It's ok to filter it's output as in x="$(printf "hi\n\n" |FILTERHERE)".
> 
> In my real problem the output comes from a perl script instead of the
> printf, and the number of trailing '\n's is *unknown*.

If you use ksh, for example, you can also use another approach, say,

printf "hi\n\n" | read -d $'\a' x
printf "$x" | cat -A

so that you can avoid command substitution.

Janis

> 
> I'm curious why the shell is stripping the \012 chars, and only at the
> end.  I tried removing '\n' from IFS and OFS.
> 
> I thought you could:
> 
>   x="$(cat ./foo)"
> 
> and be assured that
> 
>   echo "$x"|md5sum
>   md5sum ./foo
> 
> would be identical. Try for example:
> 
>   md5sum  <(tail -2 /etc/group) <(printf "$(tail -2 /etc/group)")
> 
> Are there any other cases other than the trailing '\n's where
>   x="$(cat ./foo)"
> will not agree w/contents of file ./foo?
> 
> --
> thanks
> 

0
Janis
12/30/2013 7:51:19 AM
On Mon, 30 Dec 2013 01:02:32 +0100, Cyrus Kriticos
<cyrus.kriticos@googlemail.com> wrote:

> > None solve the problem [...]
> 
> No.
> 
> $ x="$(printf "%s" "hi\n\n")"
> $ printf "$x"|cat -A
> hi$
> $
> 
> It works fine.

I think you misunderstood the original problem.



0
pk
12/30/2013 9:05:30 AM
In article <1388356484.623199@nfs20.nyx.net>,
 anonb6e9@nyx.net (Name withheld by request) wrote:

> Ex
>   
>   ~ $ printf "hi\n\n"|cat -A
>   hi$
>   $
>   ~ $ x="$(printf "hi\n\n")"
>   ~ $ printf "$x"|cat -A
>   hi~ $
> 
> Why are the trailing '\n's not in "$x"?  Is there any way to stop this,
> w/o using a tempfile?

From the bash man page description of Command Substitution:

Bash performs the expansion by executing command and replacing the 
command substitution with the standard output of the command, with any 
trailing newlines deleted.

I don't see any way to stop it.  Quoting prevents word splitting, but 
not the trailing newline deletions.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
0
Barry
12/30/2013 3:22:09 PM
On 30.12.2013 16:22, Barry Margolin wrote:
> In article <1388356484.623199@nfs20.nyx.net>,
>  anonb6e9@nyx.net (Name withheld by request) wrote:
> 
>> Ex
>>   
>>   ~ $ printf "hi\n\n"|cat -A
>>   hi$
>>   $
>>   ~ $ x="$(printf "hi\n\n")"
>>   ~ $ printf "$x"|cat -A
>>   hi~ $
>>
>> Why are the trailing '\n's not in "$x"?  Is there any way to stop this,
>> w/o using a tempfile?
> 
> From the bash man page description of Command Substitution:
> 
> Bash performs the expansion by executing command and replacing the 
> command substitution with the standard output of the command, with any 
> trailing newlines deleted.
> 
> I don't see any way to stop it.  Quoting prevents word splitting, but 
> not the trailing newline deletions.

Indeed. What you can do, though, is to avoid command substitution and
use other methods. The previously for ksh posted alternative would be
for bash, e.g.,

printf "hi\n\n" | { IFS= read -d $'\a' x
printf "$x" | cat -A ;}

with some appropriately chosen delimiter.

Janis

0
Janis
12/30/2013 3:32:55 PM
Am Nym wrote:

> I'm curious why the shell is stripping the \012 chars, and only at the end.
> I tried removing '\n' from IFS and OFS.

I believe it's just the originally (7th ed shell, '79) intended utilization:

Make the output from a command quickly re-usable, which is usually a
one-liner.  Here it's just handy.

On the one hand, controlling this with a field separator would be a
cute idea, on the other hand it might complicate things further.

Stripping trailing \n if you have several lines usually makes much
less sense.  But well, it's sort of a hack anyway, although an
enormous useful one. perl avoided this problem, doesn't strip and
you're on the safe side, but almost always have to use chomp() to
strip it anyway.  I can see why Bourne was tempted to strip \n away
by default.
0
Sven
12/31/2013 12:33:19 AM
Barry Margolin <barmar@alum.mit.edu> writes:

> In article <1388356484.623199@nfs20.nyx.net>,
>  anonb6e9@nyx.net (Name withheld by request) wrote:
>
>> Ex
>>   
>>   ~ $ printf "hi\n\n"|cat -A
>>   hi$
>>   $
>>   ~ $ x="$(printf "hi\n\n")"
>>   ~ $ printf "$x"|cat -A
>>   hi~ $
>> 
>> Why are the trailing '\n's not in "$x"?  Is there any way to stop this,
>> w/o using a tempfile?
>
> From the bash man page description of Command Substitution:
>
> Bash performs the expansion by executing command and replacing the 
> command substitution with the standard output of the command, with any 
> trailing newlines deleted.
>
> I don't see any way to stop it.  Quoting prevents word splitting, but 
> not the trailing newline deletions.

OK, thanks much - the man page snip above 'trailing newlines deleted'
explains it!  

BTW - I am the original poster.

--
Thanks again to all that helped.
0
Am
12/31/2013 12:36:11 AM
Reply:

Similar Artilces:

""""""""""""""""""""""ADD ME""""""""""""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfo Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... We look forward to build a ve...

"""""""""ADD ME""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfoi Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... ...

Urgent Requirement in """""""""""""NEW YORK""""""""""""""""
Hello Partners, Please find the requirement below. Please send the updated resume along with rate and contact no. REQ#1: Title : Java Developer ( Rating Project) Duration : 6 months Rate : open Location : NY strong java, WebLogic 9.2, Web Services, Oracle REQ#2: Title : Java Developer Duration : 4 months Rate : open Location : NY Strong java, SQL REQ#3: Title : VB.Net Consultant Location : NY Duration : 4 months Rate : open Primarily looking at someone who has Excel, VB.net and Oracle (good to have). Req #4: Title : Java Developer (MSA Project) Duration : 6+ months Rate : open Location : NY Note : Please send your updated resume along with contact no karthik@bhaninfo.com : No phone calls please. Thanks & Regards Karthik BhanInfo karthik@bhaninfo.com ...

why "::", not "."
Why does the method of modules use a dot, and the constants a double colon? e.g. Math::PI and Math.cos -- Posted via http://www.ruby-forum.com/. On Oct 26, 2010, at 01:48 , Oleg Igor wrote: > Why does the method of modules use a dot, and the constants a double > colon? > e.g. > Math::PI and Math.cos For the same reason why inner-classes/modules use double colon, because = they're constants and that's how you look up via constant namespace. Math::PI and ActiveRecord::Base are the same type of lookup... it is = just that Base is a module and PI is a float....

"If then; if then;" and "If then; if;"
I have a raw data set which is a hierarchical file: H 321 s. main st P Mary E 21 F P william m 23 M P Susan K 3 F H 324 S. Main St I use the folowing code to read the data to creat one observation per detail(P) record including hearder record(H): data test; infile 'C:\Documents and Settings\retain.txt'; retain Address; input type $1. @; if type='H' then input @3 Address $12.; if type='P' then input @3 Name $10. @13 Age 3. @16 Gender $1.; run; but the output is not what I want: 1 321 s. main H 2 321 s. main P Mary E 21 F 3 321 s...

"/a" is not "/a" ?
Hi everybody, while testing a module today I stumbled on something that I can work around but I don't quite understand. >>> a = "a" >>> b = "a" >>> a == b True >>> a is b True >>> c = "/a" >>> d = "/a" >>> c == d True # all good so far >>> c is d False # eeeeek! Why c and d point to two different objects with an identical string content rather than the same object? Manu Emanuele D'Arrigo wrote: >>>> c = "/a" >>>&...

about "++" and "--"
why this program snippet display "8,7,7,8,-7,-8" the program is: main() { int i=8; printf("%d\n%d\n%d\n%d\n%d\n%d\n",++i,--i,i++,i--,-i++,-i--); } > why this program snippet display "8,7,7,8,-7,-8" Ask your compiler-vendor because this result is IMHO implementation-defined. Check this out: http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.15 http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.16 Regards, Irina Marudina fxc123@gmail.com wrote: > why this program snippet display "8,7,7,8,-7,-8&q...

"my" and "our"
Hi, while testing a program, I erroneously declared the same variable twice within a block, the first time with "my", the second time with "our": { my $fz = 'VTX_Link'; .... ( around 200 lines of code, all in the same block) our $fz = 'VTX_Linkset'; ... } So the initial contents of the $fz declared with "my" is lost, because "our" creates a lexical alias for the global $fz, thus overwriting the previous "my" declaration. It was my error, no question. But I wonder why Perl doesn't mention this - even with "use s...

"or" and "and"
Hi, I'm just getting to discover ruby, but I find it very nice programming language. I just still don't understand how the "or" and "and" in ruby... I was playing with ruby and for example made a def to print Stem and Leaf plot (for those who didn't have a statistics course or slept on it, e.g. http://cnx.org/content/m10157/latest/) Here is the Beta version of it: class Array def n ; self.size ; end def stem_and_leaf(st = 1) # if st != (2 or 5 or 10) then ; st = 1 ; end k = Hash.new(0) self.each {|x| k[x.to_f] += 1 } k = k.sort{|a, b| a[0].to_f <=&g...

"out" and "in out"
Hi i found the following explaination: In Ada, "in" parameters are similar to C++ const parameters. They are effectively read-only within the scope of the called subprogram. Ada "in out" parameters have a reliable initial value (that passed in from the calling subprogram) and may be modified within the scope of the called procedure. Ada "out" parameters have no reliable initial value, but are expected to be assigned a value within the called procedure. What does "have no reliable initial value" mean when considering the "out" parameter? By c...

Urgent Requirement for """""""""""""""INFORMATICA DEVELOPER"""""""""""""
Hello Partners, How are you ? Please find the requirements below. Title: Database/ETL Developer Duration: 6 months Location: NY Exp: 7+ Locals preferred Database/ETL requirements (Mandatory) Candidate must have worked with financial instruments, preferably Mutual Funds but, Equities are also ok. PL/SQL - packages, Stored procs, Functions, Aggregate functions, Pipelined Functions Informatica 8.6 - especially complex mappings, complex maplets, complex workflows, transformations Oracle 10g/11g Unix/Linux shell scripting ...

Urgent need """""""""""INFORMATICA DEVELOPER"""""""""""""
Hello Partners, How are you ? Please find the requirements below. Title: Database/ETL Developer Duration: 6 months Location: NY Exp: 7+ Locals preferred Database/ETL requirements (Mandatory) Candidate must have worked with financial instruments, preferably Mutual Funds but, Equities are also ok. PL/SQL - packages, Stored procs, Functions, Aggregate functions, Pipelined Functions Informatica 8.6 - especially complex mappings, complex maplets, complex workflows, transformations Oracle 10g/11g Unix/Linux shell scripting Database/ETL requirements (Optional) Data warehousing experience Threading and job concepts in 10g/11g Cost based Optimizer concepts in 10g/11g Must : Experience with XML files and partitioning concepts in Oracle, Collections, Material Views Note : No phone calls please. : send Resumes to karthik@bhaninfo.com Thanks & Regards Karthik BhanInfo karthik@bhaninfo.com ...

Relationship to "X" or not to "X"...
TABLES: Parent p_id order info Child p_iD f_id transaction info RELATIONSHIP parent::p_id = child::f_id Scripted button creates a new child record and passes the parent::p_id to the child::f_id This works fine, and when changing views to the child layout - everything is there and in the correct places. However, the portal I have on the parent table (showing child fields) is blank - shows no lines. If I change the relationship to: parent::p_id X child::f_id the portal instantly shows all transactions regardless of the order id, not just those of the parent::p_id order...

Gsub!("\n","\n")
Hi all, I'm not sure why but I assumed gsub! would allow me to replace \n with line feeds or \r for carriage returns. How do I gsub! and replace everything with a nonvisible character like newline? I was using this results.gsub!("\n","\n") but obviously that does not work :( also tried results.gsub!("\n",10.chr). No go. Kinda of frustrating for something so simple. I guess I could always do some recursion. Thanks. -- Posted via http://www.ruby-forum.com/. On Jan 19, 2009, at 7:19 PM, Simon Tan wrote: > Hi all, I'm not sure why but I assumed gsub...

Does it need a ";" at the very after of "if" and "for"
write code like: int main(void) { int a=10; if(a<20) {} } Compiler ok on dev-cpp . don't we have to add a ";" after if statement? marsarden said: > write code like: > > int main(void) > { > int a=10; > if(a<20) > {} > } > > Compiler ok on dev-cpp . don't we have to add a ";" after if > statement? The syntax for 'if' is: if(expression) statement There is no semicolon after the ) but before the statement. The statement is either a normal statement (which can be empty), ending in a semicolon:- if(expr) ...

A problem about "[ ]" "( )" "="
I want to read several images saved in a director,and give them to I1,I2 ,I3....,using the following codes: filelist=dir(['c:\MATLAB701\work\...\*.jpg']); for i=1 :length(filelist) I=imread(fullfile('c:\MATLAB701\work\...',filelist(i).name)); end; but failed. Then I used I(i)=imread... ,still failed. How could I do? "John" <mailofww@126.com> wrote in message news:ef19e12.-1@webx.raydaftYaTP... >I want to read several images saved in a director,and give them to > I1,I2 ,I3....,using the following codes: > filelist=dir(['c:\MATLAB701\work\.....

"In" "Out" and "Trash"
I just bought a new computer and I re-installed Eudora Light on my new computer. But when I open Eudora, the "In", "Out" and "Trash" links are not on the left side of the screen the way they were on my old computer. How can I get these links back on the left side of the screen? Thank you. On 25 Mar 2007 09:49:22 -0700, "abx" <abfunex@yahoo.com> wrote: >I just bought a new computer and I re-installed Eudora Light on my new >computer. But when I open Eudora, the "In", "Out" and "Trash" links >are ...

printf format ("%-{x}s","blerhg") where {x} is a variable
Hi there, I'm trying to format a printf statement. I can format a line as in "%-10s" but for the table I am trying to produce, i would prefer the number ten in that example to be variable. I'll explain what it is I am trying to do and hopefully this will help, or there will be an easier way... Say I am using a username. usernames change in length depending on who is the user. bob.geldof is shorter than fred.flinstone. I am trying to print a table like the one below bob.geldof data1 data2 1 1 2 4 3 9 fred.flinsto...

How to alias "n1" to "n 1" and "n2" to "n 2" and so on (with style)
I have the following bash function: function ..() { counter=0 case "$1" in [0-9][0-9] ) while [ $counter -lt $1 ] do cd .. counter=$(($counter+1)) done ;; * ) echo "staying where I am, give me a number (<99) next time :)" ;; esac } The allows me to move up, say 4 levels, using ".. 4" Now, typing the space annoys me so I define the following aliases: alias ..='.. 1' alias ..2='.. 2' alias ..3='.. 3' alias ..4='.. 4' alias ..5='.. 5' Not very elegant I con...

[Q] How to escape "\a" "\b" "\c" "\f" "\n" "\r" "\t" "\v" in the string output?
Hi, there. Belows are some example strings which stand for M$ Windows directory path. How can I escape the special meanings like "\a", "\n", "\r" in these M$ Windows directory name strings? C:\amail\dir1\nbar C:\bmail\dir2\tbar C:\cmail\dir3\afoo C:\fmail\dir4\vfoo C:\nmail\dir5\fbar C:\rmail\dir6\abar C:\tmail\dir7\vfoo C:\vmail\dir8\cfoo Thanks in advance. In article <1161145522.072002.20370@m7g2000cwm.googlegroups.com>, "yh" <y.hosang@gmail.com> wrote: > Hi, there. > > Belows are some example strings which stand for M$ Wi...

(mapcar 'quote '("1" "2" "3" "4"))
(mapcar 'quote '("1" "2" "3" "4")) returns ((quote "4") (quote "4") (quote "4") (quote "4")) Interesting and (for me) unexpected. Because (mapcar 'read '("1" "2" "3" "4")) returns (1 2 3 4) and (mapcar 'princ '("1" "2" "3" "4")) gives 1234("1" "2" "3" "4") Why isn't (mapcar 'quote '("1" "2" "3" "4")) returning ((quote "1") (quote "2") (quote "3") (quote "4")) Tom Haws www.hawsedc.com Probably has to do with the fact that 'arg and (quote arg) are equivalent, and LISP gets confused by the construct 'quote, which is about the same as (quote (quote arg)). But I don't pretend to know all of the mechanics of the error; the results are somewhat different in R14, BTW: Command: (mapcar 'quote '("1" "2" "3" "4")) ((<Subr: #22e3e40> "4") (<Subr: #22e3e40> "4") (<Subr: #22e3e40> "4") (<Subr: #22e3e40> "4")) ___ "Tom Haws" <hawstom@despammed.com> wrote in message news:77317472.0309160733.45ea9d8c@posting.google.com... > (mapcar 'quote '("1" "2" "3"...

case "x$DIR" in "x*/..*"
Hi, I'm trying to ensure that the variable $RPM_BUILD_DIR is: - set - not / - not /usr - does not contain .. - does not contain psaces and tabs with the following piece of shell code: case "x$RPM_BUILD_DIR" in "x") echo >&2 '$RPM_BUILD_DIR is not set' exit 1 ;; # "x/" | "x/usr" | "x*/..*" | "x* *" | "x* *" ) "x*/..*") echo >&2 '$RPM_BUILD_DIR is illegal' exit 1 ;; esac Unfortunately this doesn't work: bolinux12:afarber {544} env RPM_BUILD_DIR=/../ ./test...

email-display: "N", "D", " ": yeah; but "O"? How to MARK "O"?
My question: Subject: email-display: "N", "D", " ": yeah; but "O"? How to MARK "O"? Today is the first time ever that I've seen this "O"-mark. What is it? Here's the version I use: > mutt -v Mutt 1.5.10i (2005-08-11) Copyright (C) 1996-2002 Michael R. Elkins and others. Thanks! David David Combs schrieb: > My question: > Subject: email-display: "N", "D", " ": yeah; but "O"? How to MARK > "O"? > > Today is the firs...

Urgent JAVA Requirement in """"""NEW YORK"""""""""
Hello Partners, How are you ? Please find the requirement below. Location : NY Duration : 8 mnths Rate :Open Job description: Java/J2EE Web Service Developer =B7 (4+ years of application development experience in Java/J2EE and Web service technologies. =B7 Experience with spring & Hibernate. =B7 Experience with J2EE Application Server (preferably Web logic). =B7 Preferable Aqua logic DSP Experience =B7 Preferable Sonic ESB Composite Service experience Experience w...

Web resources about - [why are trailing '\n's missing in "$x"]: x="$(printf "hi\n\n")"; printf "$x" - comp.unix.shell

Resources last updated: 3/7/2016 4:52:19 AM