@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4



Comments:

<0> {xmb}: hi ifriend.
<1> None of those lines is exclusively alphabetic characters, since spaces and colons and question marks aren't in that list.
<2> ohh ok, so i need to include them too
<3> If you're using GNU grep, take a look at predefined chracters cl***es
<3> egrep '^[[:alpha:][:space:][:punct:]]*$' some-file
<3> er, s/alpha/alnum/
<4> is bash a programming language or is it a scripting language/interpreting language
<4> from the point of bash scripts
<1> Yes.
<2> scripting and interpretation
<0> CharminTheMoose: People refer to it as both. I've found.
<4> thanks greycat, mbuf and goldfish
<4> :0
<5> in your opinion is bash as powerful as perl?



<1> no
<2> depends on where you use it
<2> bash is awesome in embedded
<6> does anyone know if a bash shortcut to "delete to the last slash?"
<6> or if not, does anyone know if you can make your own keyboard shortcuts in bash? :D
<1> 12:27 greycat> ${variable##*/}
<5> when I run a script manually vs. crontab...and I get diff results....I've specified full paths for the files and I'm getting lacking results
<5> any common things it could be?
<5> during testing I'm running it as root to ensure it's not a rights issue or anything basic...I've specified full paths and ensured that I'm not running into missing file/bad references
<1> I've got a problem... with my code... it's, like, really bad... and stuff....
<7> haha
<1> Can you help me?
<5> lol
<7> yeah, we'll need a bit more info on your script
<7> what does it do?
<7> what are the "results" you're trying to get?
<7> etc
<5> k....I'll try to explain as direct as possible...
<1> Showing the line of code would be ideal.
<5> I'm parsing a file and dumping it via ftp to a remote site, when I run it manually it runs fine.....I was thinking it could be the interpreter
<5> does /bin/sh execute things the same as /bin/bash?
<5> (stupid question)
<1> No.
<5> k....so for a crontab I'd add the /bin/bash line in front of it for force bash to execute the script?
<8> w0rd54 can i see the script
<1> In addition to showing the line of code that fails, showing the error message you get is often helpful.
<5> greycat: not getting error msg because it's running in cron ;\
<7> is it a one liner or is a an actual file? if it's a file, make the first line say this: #!/bin/bash
<8> w0rd54 in your cron job you can put this at the end
<8> 2>&1 >> /var/log/messages
<5> k...trying that, I had /bin/sh but didn't know there was a difference in execution
<8> so if it does give an error
<1> w0rd54: are you STUPID?
<8> you can see it in th emessage log
<7> yeah there is, even if /bin/sh is a sym link to bash
<7> it execs differently
<1> or if you don't redirect it at all, you'll get it mailed to you.
<5> ok tru....set it to execute in 3 mins from now in cron
<5> I'd paste on pastebin, but I have some data that'd be bad to post public etc.....I have a feeling that my problem is related to cron only issue....figured it'd be a common mistake I made etc.
<5> thanks in advance for ***istance
<8> w0rd54 in you script what interp your using
<8> #!/bin/env bash or sh
<5> jafari: was using /bin/sh
<5> stupid mistake
<5> now it's /bin/bash
<8> ok
<5> sorry, I'm not a pro at bash scripting
<8> me either
<8> there is always stuff to learn
<5> hrm....same issue even with /bin/bash....going to reread code
<8> if you have #!/bin/bash in you file
<8> when you cron
<8> you dont need /bin/bash in front



<8> just make sure the file is executable\
<8> chmod +x
<5> yep
<5> chmod +x'd
<5> and no reference to /bin/bash in my cron
<8> 'd huh what that for
<5> it's chmod +x yes
<5> the 'd is for past tense....i.e. been done already
<7> haha
<8> lol
<5> heh sorry :P
<7> unfortunately without being able to see any of the code or output, we're not going to be able to help much
<7> there should be no problem running a script manually or from your users crontab
<7> should be identical
<1> unless he's using a command that expects a $TERM variable to be set, or a tty, ...
<7> unless maybe your script requires some env variables
<7> yeah
<5> cat -s ${WORKDIR}/${FILENAME} | sed -n "9,${NUMLINES}p" | cut -c1-97 | sed -e 's/^M//g' | sed -e 's/^L//g' | grep -v TOTALS |
<5> grep -v "\-----" | grep -v "AMOUNT" | grep -v "* End of Report:"| grep '.' | grep -v "VOID" | grep -v "CHECKS WRITTEN BY DAY
<5> SELECTED" > ${WORKDIR}/tmp.txt
<5> cat -s ${WORKDIR}/tmp.txt | sed 's/[ ]*$//'| grep '.' > ${WORKDIR}/tmp2.txt && rm ${WORKDIR}/tmp.txt && mv ${WORKDIR}/tmp
<5> 2.txt ${WORKDIR}/tmp.txt
<0> Jesus.
<5> ^^^ that's a section of code where I think the error resides....
<5> sorry for the big paste
<0> !pa
<0> !uuop
<9> USELESS USE OF PIPELINES!!!!!!
<5> too many pipes?
<0> Heh.
<0> w0rd54: What are you trying to do/
<5> ripping some data from a telnet based/derived data screen
<5> parsing it and converting it to a format that's usable by our financial carrier
<0> I see.
<5> if there was a better way, I'd do it....but they use this closed format database format that I can't easily export the info from
<0> Well, cat | sed | cut | sed | sed | grep | grep | grep | grep | grep | grep , can all be replaced most likely with one sed or awk command.
<1> | grep -v "* End of Report:" <-- shouldn't that be \* ?
<5> tru....well the problem I'm running into is that tmp.txt is only showing like 5 lines when it's run from cron
<5> when I run it manually it runs fine....
<5> could it be an extensive use of pipes?
<0> Heh, no.
<0> That's just me being silly.
<0> Sorry.
<5> ok....not a prob
<5> still learning on my end....so I wanna find what errors I'm making on code
<5> especially the errors that prevent functionality
<1> none of your basic core commands (sed, grep, etc.) will care whether you're on a terminal or not.
<1> I'd look to whatever is GENERATING the data in the first place.
<1> you mentioned telnet? Start with that.
<5> yep
<5> I verified that part is correct
<5> source file = shows up fine
<5> so from what I can thinnk it's gotta be during hte parse process
<5> because tmp.txt shows up incorrectly with only a couple lines...it has the header and footer, but that process what I pasted, I think has an error of some sort when run from cron
<1> Then run each filter individually and save off the results with tee(1)
<5> k, will do
<7> will all of the dot files be loaded up when something is run from a crontab?
<1> of course not!
<7> .bashrc, .login, etc?
<1> No.
<7> but if my login shell is /bin/bash and my script says #!/bin/bash, they aren't executed in the same way?
<7> nevermind, found it all under invocation in the man page
<8> later folks
<8> have a good one


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #bash
or
Go to some related logs:

2-axis ubuntu gameport
Table radacct is empty
#php
#linux
php5 php.ini extensions_dir
#css
#sdl
perl generate aa-zz
kubuntu lombard
configure proftpd for multiple users



Home  |  disclaimer  |  contact  |  submit quotes