[00:22:06] <jda2000> 4# type coproc [00:23:00] <jda2000> 4# type : [00:23:13] <jda2000> #4 type : [00:23:28] <jda2000> # type : [00:23:31] <evalbot> jda2000: : is a shell builtin [00:23:44] <jda2000> 4# type : [00:24:24] <jda2000> Well, Well, Someone got a pony. [00:33:54] <mute> why [00:38:35] <Cam> # test [00:38:38] <evalbot> Cam: no output [00:38:38] <Cam> # echo 1 [00:38:40] <evalbot> Cam: 1 [00:38:49] <Cam> # du -sh / [00:38:52] <evalbot> Cam: du: cannot access `/proc/230/task/230/fd/3′: No such file or directory [00:38:52] <evalbot> Cam: du: cannot access `/proc/230/task/230/fdinfo/3′: No such file or directory [00:38:52] <evalbot> Cam: etc… ( http://pastebin.com/UmbJxHCS ) [00:38:58] <Cam>
? [00:39:26] <Cam> # ping -c 5 www.google.com [00:39:28] <evalbot> Cam: bash: ping: command not found [00:39:33] <Cam> # ls /usr/bin [00:39:35] <evalbot> Cam: ls: cannot access /usr/bin: No such file or directory [00:39:38] <Cam> Hmm.. [00:39:41] <Cam> # ls /bin [00:39:43] <evalbot> Cam: awk cmp env kill nano strace uname [00:39:44] <evalbot> Cam: basename cp expr ksh nl strings uncompress [00:39:44] <evalbot> Cam: etc… ( http://pastebin.com/j3BvrF9A ) [00:40:06] <Cam> # echo pwd [00:40:07] <evalbot> Cam: pwd [00:40:11] <Cam> # pwd [00:40:11] <evalbot> Cam: /root [00:40:17] Cam leaves [00:41:11] <jda2000> mute: you win a pony if you can break evalbot. [00:41:49] <jda2000> mute: Same may be true for shbot [00:42:09] <jda2000> mute: Which doesn’t seem to be working right now. [00:42:11] <mute> So you broke evalbot? [00:42:19] <mute> shbot isn’t even here. [00:42:27] <jda2000> mute, no. [00:42:37] <Cam> breaking evalbot? [00:42:50] <jda2000> mute, shbot has to log in? [00:43:50] <jda2000> mute, Cam: No I’ve never tried to break evalbot. Not after reading about how it is constructed. To do so would be irresponsible. [00:44:39] <Cam> Where is the documentation on it? [00:44:58] <mute> considering it passes it right to a shell via pipe to qemu, doesn’t seem there’d be much way [00:45:48] <jda2000> http://www.vidarholen.net/contents/evalbot/ [00:46:49] <jda2000> mute: but I legitimately wanted to try something in a version 4 bash. [00:47:01] <jda2000> 4# type coproc [00:48:55] <mute> $ type coproc [00:48:55] <mute> coproc is a shell keyword [00:50:41] <jda2000> # echo “${BASH_VERSINFO[*]}” [00:50:41] <jda2000> echo “${BASH_VERSINFO[*]}” [00:50:42] <evalbot> jda2000: 3 2 33 1 release i486-pc-linux-gnu [00:51:15] <Cam> # echo $PS1 [00:51:16] <evalbot> Cam: no output [00:51:20] <Cam> :’( [00:52:56] <jda2000> That’s weird. I’m on 3 2 39 1 release i486-pc-linux-gnu but I get bash: type: coproc: not found [00:52:57] <chroot> what this used for in bash script? >$OUTFILE [00:53:20] <chroot> >$OUTFILE [00:53:30] <chroot> >$OUTFILE ? [00:53:40] <mute> redirects stdout to $OUTFILE [00:53:59] <jda2000> chroot: that usually directs the normal output of a command into a file. The name of the file is in the variable named $OUTPUT [00:54:44] <BlastHardcheese> also it should be quoted [00:55:10] <jda2000> What he said. [00:55:11] <chroot> jda2000, is this is also used to initial the OUTFILE ? [00:55:37] <chroot> there is nothing before >$OUTFILE [00:55:58] <jda2000> chroot, Yes, the file will be created if it does not exist. It will be over-written if it does exist. [00:56:27] <BlastHardcheese> !> > chroot [00:56:27] <greybot> chroot: Use > to write redirect STDOUT to a file: ls > myFileList. See !redir [00:56:39] <BlastHardcheese> !redir [00:56:39] <greybot> Redirections: http://bash-hackers.org/wiki/doku.php/howto/redirection_tutorial http://mywiki.wooledge.org/BashGuide/InputAndOutput#Redirection http://bash-hackers.org/wiki/doku.php/syntax/redirecti [00:56:43] <jda2000> chroot, Are you saying the it appears in the first line of the script. [00:56:47] <jda2000> chroot, Are you saying the it appears in the first line of the script? [00:56:55] <chroot> jda2000, yes, [00:56:56] <jda2000> chroot, Are you saying that it appears in the first line of the script? [00:57:11] <chroot> and what about this one: LINE= [00:57:35] <chroot> without give the exactly vaviable to LINE [00:58:45] <mute> that’s just going to set it to nothing then [00:59:11] <jda2000> chroot, That would set the value of the variable LINE to a string of length zero. [01:00:50] <jda2000> chroot, >$OUTPUT used before $OUTPUT is defined is an error. [01:01:07] <chroot> oh, i understand that, it is something like C programing languge. [01:01:30] <chroot> oh, the variable is defined before >$OUTPUT [01:01:31] <jda2000> chroot, ok. [01:02:19] <jda2000> chroot, Then, that is where the output is going to go. [01:18:10] <Cam> How do I pipe the output of something to a command? [01:18:14] <Cam> myCommand | toHere ? [01:18:33] <BlastHardcheese> Cam: yes [01:18:46] <BlastHardcheese> !| [01:18:46] <greybot> Pipes are used to send the (standard) output of one process to the (standard) input of another. foo | bar runs a process foo, sends its output on FD 1 to a process bar’s input on FD 0. Note that fo [01:18:50] <Cam> If I were writing the script toHere how would I reference what is being passed? [01:19:14] <BlastHardcheese> !stdin [01:19:15] <greybot> Standard Input is the file descriptor from which commands can read input. See !stdout !stderr and !redirtut for more info. [01:19:32] <BlastHardcheese> !faq read > Cam [01:19:33] <greybot> Cam: http://mywiki.wooledge.org/BashFAQ/001 — How can I read a file (data stream, variable) line-by-line (and/or field-by-field)? [01:19:43] <Cam> Thanks. [01:21:36] <Pupuser> Hi I use this: if [ $domain = ""] [01:21:36] <Pupuser> then [01:21:36] <Pupuser> echo “Domain shall not be empty” [01:21:36] <Pupuser> else [01:21:36] <Pupuser> echo “Ok lets go on” [01:21:37] <Pupuser> fi but it gives error [01:22:06] <Pupuser> line 6: [: 1: unary operator expected [01:22:17] <Pupuser> (I gave the domain 1) [01:22:40] <BlastHardcheese> ![[ > Pupuser [01:22:41] <greybot> Pupuser: [[ is a bash keyword similar to (but more powerful than) the [ command. See http://mywiki.wooledge.org/BashFAQ/031 and http://mywiki.wooledge.org/BashGuide/TestsAndConditionals. Unless [01:23:40] <BlastHardcheese> Pupuser: Also to test if a string is empty just use -z. And quote your variable expansions. [[ -z "$domain" ]] [01:24:55] <Pupuser> if [ -z "$variable" ] worked thanks [01:34:27] <fluter> Pupuser, use double quotes for variable will be ok [01:34:31] <fluter> !” [01:34:32] <greybot> “USE MORE QUOTES!” They are vital. Also, learn the difference between ‘ and ” and `. See http://mywiki.wooledge.org/Quotes and http://wiki.bash-hackers.org/syntax/words. [01:34:52] <fluter> if [ "$domain" = "" ] is ok even if domain is nothing [01:38:36] <Pupuser> Hi I want to combine 2 variables that I ask from the user.I ask him the domain and the username and I want to have domain@username in a variable.what can I do? [01:38:49] <twkm> learn shenn? [01:38:53] <twkm> err, shell. [01:39:05] <twkm> (you seem to prefer guessing) [01:39:17] <jda2000> Pupuser, WANTED=”$DOMAIN@$USERNAME” [01:39:26] <twkm> don’t use all upper-case variable names. [01:40:13] <jda2000> Pupuser, wanted=”$domain@$username” [01:40:35] <Pupuser> great thanks sry for asking noob questions Im just starting to learn bash [01:41:09] <twkm> i suggest people read the documentation. that seems to make people cry these days, so the channel has produced a guide. [01:42:45] <jda2000> twkm is old school. [01:43:59] <jda2000> Pupuser, The BASH FAQ as seen in the /topic is well worth the time it takes to read it. [01:45:01] <Pupuser> I’ll check it out thank you [01:48:43] <fluter> use all upper-case for globals, lower-case for locals [01:48:54] <BlastHardcheese> !varcap [01:48:55] <greybot> By convention, we capitalize environment variables (PAGER, EDITOR, SHELL, …) and internal shell variables (BASH_VERSION, RANDOM, …). All other variable names should contain at least one lowerca [01:53:01] <twkm> no. [01:53:50] <twkm> use all upper-case for environment variables known to control the behavior of other programs. all other parameters, whether shell variables or environment variables, should be other (mixed or all low [01:57:43] <jda2000> # A=1 B=3 printf “%03dn” $(seq 1 3) [01:57:44] <evalbot> jda2000: bash: seq: command not found [01:57:45] <evalbot> jda2000: 000 [01:57:50] <jda2000> Doh! [01:58:42] <jda2000> So how can I ask why this does not work: A=1 B=30 printf “%03dn” $(seq $A $B) [01:59:05] <jda2000> seq: missing operand [01:59:05] <jda2000> Try `seq –help’ for more information. [02:00:51] <jda2000> It looks like the command substitution happens before the assignments take effect. [02:01:27] <jda2000> A=1 B=30 ; printf “%03dn” $(seq $A $B) # works! [02:01:46] <BlastHardcheese> !seq > jda2000 [02:01:47] <greybot> jda2000: seq(1) is a highly nonstandard external command used to count to 10 in silly Linux howtos. Use one of these instead: for x in {1..10} (bash3.x) or for ((x=1; x<=10; x++)) (bash 2.04+) or i [02:02:39] <jda2000> Hah! I’m only fooling with it because I’m reading BASH FAQ #18 [02:03:55] <prince_jammys> !faq echo [02:03:55] <greybot> http://mywiki.wooledge.org/BashFAQ/104 — Why doesn’t foo=bar echo “$foo” print bar? [02:04:33] <twkm> as yourself when $A is expanded. [02:05:14] <jda2000> prince_jammys, twkm: Thanks! [02:05:24] <prince_jammys> welcome [02:09:13] <hanibana> what’s the best way to run a program in command line which continue running after closing terminal… I’m currently using nohup… but, the file system has been full of nohup.out files… [02:09:41] <twkm> pay more attention. [02:09:52] <twkm> alternatively, look into dtach, screen or tmux. [02:11:13] <pgas> hanibana: redirect nohup output to, say, /dev/null [02:14:05] <hanibana> pgas: yes thanks. did know it redirects command output to with > . [02:16:59] <pgas> “NOTE: your shell may have its own version of nohup” …ah csh has a nohup builtin [02:22:02] <jda2000> FYI: I am not reading BASH FAQ #18 because I want to download a lot of porn. It’s strictly for educational purposes. [02:41:41] <Pupuser> Hi I want to echo pty “pptp 192.168.10.1 –nolaunchpppd” and the ” marks shall be inside echo what shall I do? it removes the “marks [02:43:45] <krisfremen> escape them? [02:43:58] <krisfremen> as in “ [02:43:59] <Pupuser> what? [02:44:26] <BlastHardcheese> !’ > Pupuser [02:44:26] <greybot> Pupuser: Single quotes (‘) cause everything between them to be taken literally by bash. If you want to embed a ‘ inside a ‘…’, write it as the four characters, ”’: echo ‘It”’s a blast!’ [03:02:38] <chroot> hi, what is the difference between exec 3<&0 and exec 3>&0? [03:03:18] <twkm> according to the redirection section of the manual it has to do with the direction. [03:04:04] <chroot> twkm, i know it is about direction, but what’s the diference? [03:04:27] <BlastHardcheese> !< [03:04:27] <greybot> Redirections: http://bash-hackers.org/wiki/doku.php/howto/redirection_tutorial http://mywiki.wooledge.org/BashGuide/InputAndOutput#Redirection http://bash-hackers.org/wiki/doku.php/syntax/redirecti
Nov 282011