Daily Archives

Articles indexed Sunday April 25 2010

Page 16/72 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Awk appears to disconnect my DB2 session when piping

    - by greggannicott
    Hello. I'm attempting to run the following command in Korn Shell (ksh): set -A INDEXES `db2 "describe indexes for table ${TABSCHEMA}.${TABNAME} show detail" | awk '{print $1"."$2}'` What I'm attempting to achieve is place a list of the indexes over a particular table into an array which I can later iterate through. The problem is, when I run the above command the contents of the array starts with the error message of 'SQL1024N' (which is telling me that the database connection does not exist). However, if I remove the 'awk' at the end of the statement as so: set -A INDEXES `db2 "describe indexes for table ${TABSCHEMA}.${TABNAME} show detail"` it works just fine (well, to the extent its returning data. Obviously without the awk I'm not capturing the correct data). Does anyone know why the awk is having this affect? I appreciate there is more than one way to get this data, but it baffles me as to why this is happening. Thanks in advance. Greg.

    Read the article

  • Does pdksh (public domain korn shell) support associative arrays?

    - by George Jempty
    I recently ran up against a wall doing some bash shell programming where an associative array would have solved my problems. I googled about features of the Korn shell and learned that it supports associative arrays, so I installed Cygwin's pdksh (public domain korn shell). However, when trying to create an associative array in the prescribed manner (typeset -A varName), I received the following errors, so I'm beginning to suspect pdksh does not support associative arrays. ./find_actions.ksh: line 2: typeset: -A: invalid option typeset: usage: typeset [-afFirtx] [-p] name[=value] ... Guess I'll be considering Perl instead, but I really wanted a good excuse to learn a dialect/language new to me

    Read the article

  • xcode compile options

    - by joels
    I am compiling from the command line with gcc -o output-file $(mysql_config --cflags) main.c $(mysql_config --libs) How can I add the extra params to xcode compiling options? gcc -o output-file $(mysql_config --cflags) main.c $(mysql_config --libs)

    Read the article

  • AS2 Water Fluid

    - by NebNeb
    Would it be possible to have water fluid follow the mouse. For example, you place the mouse in the middle of the screen and all the drops of water come there.

    Read the article

  • How to warn for the use of unset variables in a korn shell script

    - by Lepu
    Is there any way to throw errors or warnings in a korn shell script to prevent the use of unset variables ? Let's assume I have a temporary folder that I want to remove. TEMP_FILES_DIR='/app/myapp/tmp' rm -Rf $TEMP_FILE_DIR #notice the misspelling How to prevent this kind of mistakes before they actually happen? I know the script should check for file existence and empty string before attempting to remove, this is just a silly example to illustrate a mistake that could have been avoided with some warnings. I don't know if this feature exists in ksh. If it does exist, how do you turn it on?

    Read the article

  • What would be the right way to declare an array within a script that will be called by cron?

    - by Nano Taboada
    I've written a Korn Shell script that sets an array the following way: set -A fruits Apple Orange Banana Strawberry but when I'm trying to run it from within cron, it raises the following error: Your "cron" job on myhost /myScript.sh produced the following output: myScript.sh: -A: bad option(s) I've tried many crontab syntax variants, such as: Attempt 1: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/script/myScript.sh Attempt 2: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/script/./myScript.sh Attempt 3: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * cd /path/to/script && ./myScript.sh Any workaround would be sincerely appreciated. Thanks much in advance!

    Read the article

  • What would be the simplest way to deal with a text file using JSP?

    - by Nano Taboada
    First and foremost I should acknowledge that I have no experience at all using Java ServerPages, but I'm positive about achieving this task if you guys help me out a bit since it doesn't seem like something difficult for a seasoned JSP programmer. Anyway the thing is, there's an actual running JSP application within a *NIX box which I somewhat administer with kind of good permissions. The idea is to create a new but dead simple JSP page to control some Korn Shell scripts I've got running there. So the goal is to make some sort of HTML form that will be writing some kind of scriptStatus.on / scriptStatus.off file: #!usr/bin/ksh # coolScript.sh # This is my cool script that is being launched by cron every 10 minutes. if [ -e scriptStatus.off ] then # monitor disabled else # monitor enabled fi which then can be checked for existence within the running script, therefore allowing to easily activate / deactivate it without actually have do deal with cron. Please let me know if all this does make any sense and don't hesitate to ask as much questions as needed. Thanks much in advance!

    Read the article

  • Korn shell wraparound

    - by allenratcliff
    Okay, I'm sure this is simple but it is driving me nuts. I recently went to work on a program where I've had to step back in time a bit and use Redhat 9. When I'm typing on the command line from a standard xterm running Korn shell, when I reach the end of the line the screen slides to the right (cutting off the left side of my command) instead of wrapping the text around to a new line. This makes things difficult for me because I can't easily copy and paste from the previous command straight from the command line. I have to look at the history and paste the command from there. In case you're wondering, I do a lot of command-line awk scripts that cause the line to get quite long. Is there a way to force the command line to wrap instead of shifting visibility to the right side of the command I'm typing? I've poured through man page options with no luck. I'm running XFree86 4.2.99.903(174) and KSH 5.2.14. Thanks.

    Read the article

  • Korn Shell code to send attachments with mailx and uuencode?

    - by Nano Taboada
    I need to attach a file with mailx but at the moment I'm not having a lot of success. Here's my code: subject="Something happened" to="[email protected]" body="Attachment Test" attachment=/path/to/somefile.csv uuencode $attachment | mailx -s "$subject" "$to" << EOF The message is ready to be sent with the following file or link attachments: somefile.csv Note: To protect against computer viruses, e-mail programs may prevent sending or receiving certain types of file attachments. Check your e-mail security settings to determine how attachments are handled. EOF Any feedback would be highly appreciated. Update I've added the attachment var to avoid having to use the path every time.

    Read the article

  • g++ not linking header files properly

    - by cambr
    I am using cygwin libraries to run C and C++ programs on Windows. gcc runs fine, but with g++, I get a long list of errors. I think these erros are because of linking problems with C libraries. Can you suggest what I need to do to fix this? beginning error lines: In file included from testgpp.cpp:1: /cygdrive/c/cygwin/bin/../lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdio:52:19: stdio.h: No such file or directory In file included from testgpp.cpp:1: /cygdrive/c/cygwin/bin/../lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdio:99: error: `::FILE' has not been declared /cygdrive/c/cygwin/bin/../lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdio:100: error: `::fpos_t' has not been declared /cygdrive/c/cygwin/bin/../lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdio:102: error: `::clearerr' has not been declared /cygdrive/c/cygwin/bin/../lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdio:103: error: `::fclose' has not been declared /cygdrive/c/cygwin/bin/../lib/gcc/i686-pc-cygwin/3.4.4/include/c++/cstdio:104: error: `::feof' has not been declared the whole error dump: PasteBin

    Read the article

  • ab benchmarking testing

    - by Tennyson
    I have a question about ab benchmarking test, if i need to measure the time the server takes to serve IO.php with persistent connection. does the persistent connection mean i need to input "./ab -k ........." or "./ab -n 1000 -c 100 ........." Thanks a lot

    Read the article

  • putty external text editor?

    - by matthewsteiner
    I'm new to ssh and linux in general. I've got putty set up and I can connect to my server and list files and everything. I'm wondering how I can edit a file using notepad++ (or another editor). Is there a way to have it automatically download and upload through ssh? How else do you edit a file? Thanks

    Read the article

  • There is a system alert of (13, 'Permission denied'), how to solve that?

    - by Semanty
    def upload_file(request, step_id): def handle_uploaded_file (file): current_step = Step.objects.get(pk=step_id) current_project = Project.objects.get(pk=current_step.project.pk) path = "%s/upload/file/%s/%s" % (settings.MEDIA_ROOT, current_project.project_no, current_step.name) if not os.path.exists (path): os.makedirs(path) fd = open(path) for chunk in file.chunks(): fd.write(chunk) fd.close() if request.method == 'POST': form = UploadFileForm(request.POST, request.FILES) if form.is_valid(): handle_uploaded_file(request.FILES['file']) return HttpResponseRedirect('/success/url/') else: form = UploadFileForm() return render_to_response('projects/upload_file.html', { 'step_id': step_id, 'form': form, })

    Read the article

  • Rhino Mocks and ordered test with unordered calls

    - by Shaddix
    I'm using Rhino.Mocks for testing the system. I'm going to check the order of calling .LoadConfig and .Backup methods. I need .LoadConfig to be the first. Currently the code is like this: var module1 = mocks.Stub<IBackupModule>(); var module2 = mocks.Stub<IBackupModule>(); module1.Expect(x => x.Name).Return("test"); module2.Expect(x => x.Name).Return("test2"); using (mocks.Ordered()) { module1.Expect(x => x.LoadConfig(null)); module2.Expect(x => x.LoadConfig(null)); module1.Expect(x => x.Backup()); module2.Expect(x => x.Backup()); } mocks.ReplayAll(); The problem is, that there's also a call to .Name property, and i'm not interesting when it'll be called: before .LoadConfig or after the .Backup - it just doesn't matter. And when I run this I'm getting Exception: Unordered method call! The expected call is: 'Ordered: { IConfigLoader.LoadConfig(null); }' but was: 'IIdentification.get_Name();' Is there a way to deal with this? Thanks

    Read the article

  • Connecting to a Websphere MQ in Java with SSL/Keystore

    - by javaExpert
    I'd like to connect to a Websphere 6.0 MQ via Java. I have already working code for a "normal" queue, but now I need to access a new queue which is SSL encrypted (keystore). I have been sent a file called something.jks, which I assume is a certificate I need to store somewhere. I have been searching the net, but I can't find the right information. This is the code I use for the "normal" queue. I assume I need to set some property, but not sure which one. MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory(); connectionFactory.setChannel(channel_); connectionFactory.setHostName(hostname_); connectionFactory.setPort(port_); connectionFactory.setQueueManager(queueManager_); connectionFactory.setTransportType(1); connectionFactory.setSSsetSSLCertStores(arg0) Connection connection = connectionFactory.createConnection(); connection.setExceptionListener(this); session_ = connection.createSession(DEFAULT_TRANSACTED, DEFAULT_ACKMODE); connection.start(); javax.jms.Queue fQueue = session_.createQueue(queue_); consumer = session_.createConsumer(fQueue);

    Read the article

  • How to retrieve the location of a control on the view?

    - by amok
    I have a button on a view, I want to add another button next to it when the first button is touched. Therefore I need it's top left corner to do the math. Here's what is puzzling me greatly: // this code is executed when the button is pressed NSLog(@"X:%f",moreButton.frame.origin.x); that returns on the first and second click the followings: 2010-04-24 22:58:25.883 iPad PopOver[8095:40b] X:-1.999002 2010-04-24 22:58:25.884 iPad PopOver[8095:40b] Y:0.000000 why and how can I get the x,y of an existing button on the view? (button created via IB) Thanks! mE ps: I have looked at similar posts and my code looks fine but I keep getting zeros (it's an ipad app if matters in any way)

    Read the article

  • CVS branch name from tag name

    - by Jamie
    I have a number of modules in CVS with different tags. How would I go about getting the name of the branch these tagged files exist on? I've tried checking out a file from the module using cvs co -r TAG and then doing cvs log but it appears to give me a list of all of the branches that the file exists on, rather than just a single branch name. Also this needs to be an automated process, so I can't use web based tools like viewvc to gather this info.

    Read the article

  • Korn Shell SegFault

    - by C. Ross
    I have found the following script causes a segmentation fault and core in kshell on AIX. Can anyone explain why I get the following results? Seg Fault doOutput(){ Echo "Something" } doOutput() >&1 OR doOutput(){ Echo "Something" } echo `doOutput()` No Output doOutput(){ Echo "Something" } doOutput() Correct doOutput(){ Echo "Something" } doOutput OR doOutput(){ Echo "Something" } doOutput >&1

    Read the article

  • Korn Shell - Test with variable that may be not set

    - by C. Ross
    I have the following code in KornShell FAILURE=1 SUCCESS=0 isNumeric(){ if [ -n "$1" ]; then case $1 in *[!0-9]* | "") return $FAILURE; * ) return $SUCCESS; esac; else return $FAILURE; fi; } #... FILE_EXT=${FILE#*.} if [ isNumeric ${FILE_EXT} ]; then echo "Numbered file." fi #... In some cases the file name not have an extension, and this causes the FILE_EXT variable to be empty, which causes the following error: ./script[37]: test: 0403-004 Specify a parameter with this command. How should I be calling this function so that I do not get this error?

    Read the article

  • Make Arrow and delete keys work in Korn shell Command line

    - by user66854
    Hi all, I am new to unix and am using sun solaris (v10 i think) . I have my shell set as korn shell . i am wondering how to make the arrow keys and delete key work in the command line . I have done set -o emacs and the backspace works , but not the arrow keys and the delete keys . Also is it possible to set the up and down arrow key to cycle through the command line history ? . any help is appreciated .

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >