/srv/irclogs.ubuntu.com/2015/02/07/#ubuntu-bugs.txt

=== IKRAM_ is now known as IKRAM
=== drkokandy_ is now known as drkokandy
Blue_Hello!19:28
penguin42Hey19:30
Blue_I am on Ubuntu, I found out that on C shell, the command, source script arg, takes the arg as an empty string. This error does not occur in Linux Red Hat. Is the error documented in the Ubuntu website?19:31
* penguin42 hasn't done C shell for about 20 years :-)19:32
penguin42can you give me the exact line you typed and what it says?19:32
Blue_First, at the prompt, I type the command, csh, to get to the C shell. Second, I execute the command, source abc.csh abc and the output: The first parameter is . In the abc.csh file, it has two statements. First statement:#/bin/csh and the second statement:echo The first parameter is $119:43
Blue_I also type the command: chmod 777 abc.csh after creating the file abc.csh19:45
penguin42hang on, that first line should be #!/bin/csh19:45
penguin42the ! is important19:45
Blue_Sorry, yes, it was #!/bin/csh19:46
Blue_I mis-typed it.19:46
penguin42no problem19:46
penguin42OK, so what happens with that script?19:47
Blue_After I create the file abc.csh, I run the command chmod 777 abc.csh. Then, I ran the command, source abc.csh abc. The output should be The first parameter is abc. However, the actual output is The first parameter is.19:49
Blue_After I created the file abc.csh, I ran the command chmod 777 abc.csh. Then, I ran the command, source abc.csh abc. The output should be The first parameter is abc. However, the actual output was: The first parameter is19:50
penguin42ok, so I've just done that on ubuntu u and it seems to work and shows the parameter, so I'm not sure why it's not working for you; but the other thing is you've not quite got the reason for doing the chmod - you don't need to use chmod if you're going to use source, you only need it if you run it directly19:50
Blue_Did you do it on Ubuntu 14.04?19:52
penguin42hmm no, I wonder if I have a .04 around19:52
Blue_I did it on 13.04 also.19:53
* penguin42 looks which VMs he has19:54
penguin42ah 14.04 is trusty isn't it?19:54
Blue_It should.19:54
penguin42ah, I've got a 14.04 vm here19:55
penguin42ok, so an observation; on 14.10 it's using tcsh when you ask for csh, on 14.04 it's using bsd-csh19:55
Blue_https://wiki.ubuntu.com/Releases19:55
penguin42Blue_: Which shell are you in when you do the source?19:56
Blue_I ran the command, csh, to go to the C shell.19:56
penguin42ok19:56
penguin42Blue_: So yes, this looks like a difference in behaviour between bsd-csh and tcsh19:57
Blue_It may work on tcsh but it does not work on csh19:57
penguin42Blue_: Many systems just run tcsh when you ask to run csh19:58
penguin42Blue_: Do you understand what the 'source' is for and what the chmod is for?19:58
Blue_Is it for setting the environment on the current shell?20:00
penguin42no20:01
Blue_Okay, what does the 'source' is for?20:01
penguin42Blue_: 'source' reads the commands from the file you specify as if you had typed them at the command prompt,  if   you do the chmod and then do    ./abc.csh   it runs abc.csh in a new shell - it's only for the later case that you need the chmod20:01
Blue_Okay, thanks!20:03
penguin42Blue_: now if you do the ./abc.csh that works on both bsd-csh and tcsh20:03
Blue_Okay, thanks!20:04
penguin42Blue_: The command you run with csh goes through a chooser that picks what to run, you can change it with  update-alternatives,   so if you install tcsh  you can make  csh   run that20:04
Blue_If I do not have tcsh installed, I ran the command, source abc.csh abc. I do not see the output as The first parameter is abc20:07
Blue_ If I do not have tcsh installed, I ran the command, source abc.csh abc. I do not see the output as: The first parameter is abc.20:08
penguin42right, it's just a difference in the behaviour of tcsh and bsd-csh20:08
penguin42both work if you do ./abc.csh hello    instead of using source20:09
Blue_Is the bug filed in Ubuntu?20:11
penguin42I don't think it's a bug20:11
penguin42it's just a difference between bsd-csh and tcsh20:11
penguin42Blue_: Passing parameters through source is not that common, actually using source isn't that common20:13
Blue_If I go to a Linux Red Hat and run the command, csh, Then run the command, source abc.csh abc. I can see the output as: The first parameter is abc.20:13
penguin42Blue_: Whether it's a bug in bsd-csh you'd really want to take up with the bsd-csh guys, because I'm not sure it's defined20:13
penguin42Blue_: So what makes you think it's a bug in the csh ubuntu uses?20:14
penguin42Blue_: What is the right definition of the csh behaviour of source?20:14
hggdhwell, source (or "." in bash) is not THAT uncommon. What is uncommon is passing parameter to it20:14
penguin42right20:15
* penguin42 isn't sure if csh is covered by posix or not or if there is any fixed definition of it20:15
hggdhyeah, neither am I20:15
Blue_If I go to a Ubuntu and run the command, csh, Then run the command, source abc.csh abc. I should see the output as: The first parameter is abc. The behavior should be the same as in the Linux Red Hat. Am I correct?20:15
hggdhBlue_: penguin42 has gone thru already. Summary is it depends: is csh and tcsh are identical, version differences, etc20:16
penguin42Blue_: http://www.kitebird.com/csh-tcsh-book/csh.pdf  doesn't specify parameters to source (page 14)20:16
penguin42sorry, 1520:17
penguin42Blue_: No, you're wrong20:17
penguin42Blue_: You're failing to understand 1) The difference between source and running a shell script directly   2) What defines the behaviour of source   3) That there are differences between different implementations20:17
penguin42Blue_: Compare that document above with the tcsh manpage http://www.kitebird.com/csh-tcsh-book/tcsh.pdf  page 34   that lists it's source takes args20:18
hggdhand, now, one should point out that tcsh and csh are *not* the same thing20:19
Blue_I am sorry. I do not understand why there are different behaviors between Red Hat Linux and Ubuntu.20:21
penguin42Blue_: Because there are multiple implementations of csh, they have subtle different behaviours20:22
penguin42Blue_: The feature you're using is one of these differences because you're not using the feature you think you are20:23
penguin42Blue_: Go and read those two documents I pasted which define the source command in two different csh versions20:24
Blue_I apologize to repeat my question because I still do not quite understand. Is Red Hat Linux csh is the same as tcsh? I did the command, ps -p $$, in the Red Hat Linux. I saw CMD=csh.20:35
Blue_Is Ubuntu csh is not the same as tcsh? Is that the reason I am seeing different behaviors between Ubuntu and Red Hat Linux?20:36
penguin42correct, the csh on 14.04 is bsd-csh not tcsh20:38
penguin42(by default if you just install csh, you can install tcsh if you want)20:39
hggdhand, usually, tcsh will set itself as csh20:44
Blue_I googled bsd-csh and was unable to find its definition. What are the difference between bsd-csh and csh? Is bsd-csh the same as csh?20:44
penguin42see the manpages I posted20:46
hggdhbsd csh was also known as Berkeley csh. 'bsd' means "Berkeley Software Distribution"20:46
penguin42right, bsd was one of the early unix systems20:46
penguin42I think bsd systems had the original csh but not 100% sure on that20:47
hggdhand we owe a LOT to the folks at UC-Berkeley20:47
hggdhnot sure either. I do not remember if csh started at Bell Labs, and bsd-csh was a variant20:49
hggdhah, wikipedia to the rescue -- csh was authored by Bill Joy, while he was at UC-B20:51
penguin42yeh that rings a bell20:51
hggdhso bsd-csh and csh are the same20:52
Blue_If Red Hat Linux csh is the same as tcsh? Why did I see CMD=csh after running the command, ps -p $$, in the Red Hat Linux? <hggdh> said, tcsh will set itself as csh. Is it the answer?20:54
Blue_If Red Hat Linux csh is not the same as tcsh, why did I see CMD=csh after running the command, ps -p $$, in the Red Hat Linux? <hggdh> said, tcsh will set itself as csh. Is it the answer?20:55
hggdhBlue_: because usually tcsh will install itself as csh (it *is* a C shell, after all). But I do not know if RH uses tcsh or csh. If I were to do it, I would go tcsh20:55
hggdhBlue_: so yes, this is the answer20:55
hggdhprobably :-)20:56
hggdhBlue_: you probably can find it by 'rpm -q -a | grep csh' on RH system20:56
hggdhif you only see tcsh shown as installed, then there you go20:57
Blue_Yes, I saw tcsh on the Red Hat Linux machine. I tried the command, rpm -q -a | grep csh, on Ubuntu. I gave the error: rpm:Command not found.21:03
Blue_ Yes, I saw tcsh on the Red Hat Linux machine. I tried the command, rpm -q -a | grep csh, on Ubuntu. It gave the error: rpm:Command not found.21:04
Blue_May be rpm is a Red Hat command only.21:05
Blue_rpm is Red Hat specific.21:06
hggdhrpm is available on RH, Fedora, and CentOS, at least21:08
hggdhmaybe it is out of your default path21:08
hggdhon Debian (and variants, like Ubuntu) you should use 'dpkg -l \*csh'21:10
Blue_hggdh++: Thanks! I ran the command, dpkg -l \*csh, on Ubuntu and found Name=ii csh. Description=Shell with C-like syntax21:24
Blue_hggdh++: Thanks! I ran the command, rpm -q -a | grep csh on Red Hat Linux and found tcsh.21:25
Blue_The reason why there are different behaviors in Ubuntu and Red Hat Linux is Ubuntu uses Berkeley Software Distribution C shell and Red Hat Linux uses tcsh. Am I correct?21:31
sfpwould a member of ubuntu-bugcontrol please nominate bug #1409798 for 14.04 and 14.10?22:19
ubot5bug 1409798 in dropbear (Debian) "enable hmac-sha2-256, hmac-sha2-512 MAC algorithms" [Unknown,New] https://launchpad.net/bugs/140979822:19
hggdhBlue_: correct23:47
hggdhsfp: Trusty and Utopic have been targeted23:50
tewardhggdh: boo you stole it from me23:51
* teward glares23:51
tewardnah i kid :)23:51
hggdhteward: heh23:52

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!