Search Results

Search found 14591 results on 584 pages for 'scripting language'.

Page 82/584 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • Run a specific command from a directory

    - by Cameron Kilgore
    I have a bash script where I need to run an init utility within a directory with a configuration file defined. I don't think it's possible to explicitly tell the utility to run the file as an argument, so what I need to do is go to the directory with the config file, and then run the command. I have some logic in place, but its not working -- the utility never runs. Is there any way I can tell the script to go to this directory, and then run the script? cd /var/www/testing-dev.example.co eval "standardprofile"

    Read the article

  • Ubuntu - executable file - variable assignment throwing error on script run

    - by newcoder
    I am trying to run a small script - test - on ubuntu box. It is as follows: var1 = bash var2 = /home/test/directory ... ... <some more variable assignments and then program operations here> ... ... Now every time I run it, then it throws errors: root@localhost#/opt/test /opt/test: line 1: var1: command not found /opt/test: line 3: var2: command not found ... ... more similar errors ... Can someone help me understand what is wrong in this script? Many thanks.

    Read the article

  • merge pieces of file together

    - by veilig
    I have a directory tree of files I need to loop through and reformat the lines. can I do this with sed with some combination of find? for each file, I'll need to adjust the text in the file from ... * @category Foo * @package Bar ... into just this (Remove the @category line, but prepend the value to the package annotation value) ... * @package Foo/Bar ... what is the most efficient way of doing this? its a few hundred files that will be modified.

    Read the article

  • Install correct libraries depending on 64/32 bit

    - by Rich
    I am using Bash to install a customised version of JBoss, and one of the things I would like to do is install the correct version of the Apache Portable Runtime, which is a native binary. This script could be run on both 32 and 64 bit versions of RHEL. What are my options for identifying which version of the APR to install? I think we only have 32bit and x64-based systems here. I would still like to identify i64 systems so that the script can refuse to install on that type of machine. I am aware of using uname -m and grepping /proc/cpuinfo to find out, but was wondering which approach others would recommend?

    Read the article

  • SHELL OR PERL QUESTION

    - by user150674
    I have a very large file, named 'ColCheckMe', tab-delimited, that you are asked to process. You are told that each line in 'ColCheckMe' has 7 columns, and that the values in the 5th column are integers. Using shell functions indicate how you would verify that these conditions were satisfied in 'ColCheckMe' K got this... nawk ‘ NF != 7 { Printf(“[%d] has invalid [%d] number of fileds\n”, FNR, NF) } $5 !~ /^[0-9]+$/ { Printf(“[%d] 5th field is invalid [%s]\n”, FNR, $5) }’ ColCheckMe Now, 2. In with the similar file, you are told that each value in column 1 is unique. How would I verify that? Also write a shell function that counts the number of occurrences of the word “SpecStr” in the file 'ColCheckMe' Any one can help in SHELL or everything including the first in PERL Scripting.

    Read the article

  • Who does non-decimal bignums with floating radix point?

    - by boost
    Nice as the Tcl libraries math::bignum and math::bigfloat are, the middle ground between the two needs to be addressed. Namely, bignums which are in different radices and have a radix point. At present math::bignum only handles integers (afaict) and math::bigfloat won't let you specify different radices to math::bigfloat::fromstr (ditto). Does anyone know of a library, for any of the major scripting languages (e.g. Tcl, Perl, Python, Ruby, Lua) or less major ones (newLISP for example), which implements bignums in different radices with handling for radix point?

    Read the article

  • How do I prepare myself for a summer of working on Python using Linux environment?

    - by Shailesh Tainwala
    Hi, I have used just Windows for programming so far. Now, I have an internship starting in two weeks and I will be using just Linux environment with Python programming language. I've installed Ubuntu on my system but have no exposure to shell scripting. I need some advice on how I can quickly learn to use the Linux terminal quickly. Any books or web resources that you can suggest? Also, is there a particular IDE that is generally preferred for Python programming on Linux, or is Vim preferred? How can I best prepare myself for the internship ahead? Thanks for taking the time.

    Read the article

  • Storing date and time as epoch vs native datetime format in the database

    - by zakovyrya
    For most of my tasks I find it much easier to work with date and time in the epoch format: it's trivial to calculate timespan or determine if some event happened before or after another, I don't have to deal with time-zone issues if the data comes from different geographical sources, in case of scripting languages what I usually get from database when I request a datetime-typed column is a string that I need to parse in order to work with it. This list can go on, but for me in order to keep my code portable that's enough to ditch database's native datetime format and store date and time as integer. What do you guys think?

    Read the article

  • ffmpeg screen capture

    - by Mirai
    I wrote this script for some basic screen capture; it gets the window dimensions then uses the ffmpeg binary to record. I suspect there is a better way (maybe with the ffmpeg library), but scripting is what I know and ffmpeg generally works. Any software (other than recordmydesktop), or improvements to the script are welcome. info=`xwininfo -frame` H=`echo "$info" | grep Height | sed -E "s/^.*: ([[:digit:]]+)$/\1/"` W=`echo "$info" | grep Width | sed -E "s/^.*: ([[:digit:]]+)$/\1/"` offset=:0.0+`echo "$info" | grep Corners | sed -E "s/^.*:[[:space:]]+\+([[:digit:]]+\+[[:digit:]]+)[[:space:]]+.+/\1/" | tr + ,` /usr/local/bin/ffmpeg -f x11grab -s ${W}x${H} -r 45 -i $offset -sameq -f avi ~/videos/`date +%Y-%m-%d-%H%M%s`_vid & echo $! > /tmp/$(basename $0)-$USER

    Read the article

  • Ajax And REST: Can I send an ajax request to a REST service and recieve response?

    - by Morteza M.
    Hi everybody here, I want to use mootools and SqueezBox class to handle a request to a RESTful service. I don't want to use any server-side script. I am using AJAX. I send a request to the following url using GET method. http://www.idevcenter.com/api/v1/links/links-upcoming.json but I receive a 404 error. Is it because cross-site scripting? here is my code: SqueezeBox.initialize({handler:'url',ajaxOptions:{method:'GET'}}); $('a.modal').addEvent('click',function(e){ new Event(e).stop(); SqueezeBox.fromElement($('a.modal')); }); In Firebug console, sometimes 'aborted' is shown and sometimes '404'.what is wrong with that?

    Read the article

  • shell script problem: does not work on the terminal, but works in a script

    - by jrharshath
    Hi, I was playing with shell scripting, when a strange thing happened. I need someone to explain it. I have a file 'infile', contents: line one line2 third line last a test script test.sh, contents: read var1 echo $var1 i executed: cat infile | ./test.sh output was line one Then I did: cat infile | read var1 echo $var1 Result: a blank line. I even tried cat infile | read var1; echo $var1; same result. why does this happen?

    Read the article

  • How can I implement incremental (find-as-you-type) search on command line?

    - by florianbw
    I'd like to write small scripts which feature incremental search (find-as-you-type) on the command line. Use case: I have my mobile phone connected via USB, Using gammu --sendsms TEXT I can write text messages. I have the phonebook as CSV, and want to search-as-i-type on that. What's the easiest/best way to do it? It might be in bash/zsh/Perl/Python or any other scripting language. Edit: Solution: Modifying Term::Complete (http://search.cpan.org/~jesse/perl-5.12.0/lib/Term/Complete.pm) did what I want. See below for the answer.

    Read the article

  • getting web page data as json object?

    - by encryptor
    I have a url, the data of which page i need as a json object. I ve tried xmlhttprequest and ajaxobject both but doesnt work. It doesnt even give a responseText when I give it as an alert Ill post both the code snippets here. url = http://mydomain.com:port/a/b/c AJAX : var ajaxRequest = new ajaxObject(URL); ajaxRequest.callback = function (responseText,responseStatus) { alert(responseStatus); JSONData = responseText.parseJSON(); processData(JSONData); } USING xmlhttprequest: var client = new XMLHttpRequest(); client.open('GET',URL,true ); data = JSON.parse(client.responseText); alert(data.links.length); can someone please help me out with this. I understand cross scripting may be an issue, but how to come over it? and shouldn't then too it should give the alerts as zero or null

    Read the article

  • VB6 Parser/Lexer/Scripter

    - by rlb.usa
    I've got a game in VB6 and it works great and all, but I have been toying with the idea of creating a scripting engine. Ii'm thinking I'd like VB6 to read in flat text script files for me and then lex/parse/execute them. I have good programming experience, and I've built a simple C compiler, as well as a LOGO emulator before. My question is: Are there any tools that I can use, like Lexx/Yakk/Bison to help me? How should I approach this problem in regards to lexing, parsing, and feeding the commands back to VB6 so I can handle them? Is this idea a BAD IDEA in the sense that there are too many obstacles in the way (For example, building minesweeper in assembly, though not impossible, is very difficult, and a bad idea.)?

    Read the article

  • Scoping in embedded groovy scripts

    - by Aaron Digulla
    In my app, I use Groovy as a scripting language. To make things easier for my customers, I have a global scope where I define helper classes and constants. Currently, I need to run the script (which builds the global scope) every time a user script is executed: context = setupGroovy(); runScript( context, "global.groovy" ); // Can I avoid doing this step every time? runScript( context, "user.groovy" ); Is there a way to setup this global scope once and just tell the embedded script interpreter: "Look here if you can't find a variable"? That way, I could run the global script once. Note: Security is not an issue here but if you know a way to make sure the user can't modify the global scope, that's an additional plus.

    Read the article

  • Win32 script environment for testing http redirects?

    - by Anders Lindahl
    The past few days I've been working with setting up an Apache server on Windows. The server is supposed to host several .htaccess files, each redirecting (or, in some cases, proxying) to different hosts. I want to create tests for these redirectons, and the solution I'm currently considering is a CGI script running on the same server, sending GET requests to it and verifying that it gets the correct redirection headers back. A scripting solution (vscript/jscript) seems worth exploring, but so far I've only managed to rule out Microsoft.XMLHTTP because it follows the redirect "behind the scenes". Are there any libraries or other solutions already present on a reasonably standard Windows Server that can do this kind of low-level HTTP work? If not, any other suggestions of simple environments to set up for verifying redirects?

    Read the article

  • Shell script to count files, then remove oldest files

    - by Nic Hubbard
    I am new to shell scripting, so I need some help here. I have a directory that fills up with backups. If I have more than 10 backup files, I would like to remove the oldest files, so that the 10 newest backup files are the only ones that are left. So far, I know how to count the files, which seems easy enough, but how do I then remove the oldest files, if the count is over 10? if [ls /backups | wc -l > 10] then echo "More than 10" fi

    Read the article

  • Validating parameters to a bash script

    - by nickf
    I'm a total newbie to doing any bash scripting, but I came up with a basic one to help automate the process of removing a number of folders as they become unneeded. #!/bin/bash rm -rf ~/myfolder1/$1/anotherfolder rm -rf ~/myfolder2/$1/yetanotherfolder rm -rf ~/myfolder3/$1/thisisafolder This is evoked like so: ./myscript.sh <{id-number}> The problem is that if you forget to type in the id-number (as I did just then), then it could potentially delete a lot of things that you really don't want deleted. Is there a way you can add any form of validation to the command line parameters? In my case, it'd be good to check that a) there is one parameter, b) it's numerical, and c) that folder exists; before continuing with the script.

    Read the article

  • Using an ActiveX object from an Outlook hosted webpage - possible?

    - by Nic Wise
    I'm trying to do the following: We have an outlook plugin, written in .NET (and C++). It does various things, and is manually installed on the end users machines (usually via AD deployment or similar) We are changing our search to use a webpage-based search, but from within outlook. That part is ok, however we want to communicate from the webpage to the surrounding outlook application. We can call into outlook by exposing an ActiveX object from our plugin, however we get security warnings, even if it's signed and marked as safe for scripting. Is this even possible? Has anyone done it? Anyone have a better way of doing it? We only need to pass in a small amount of data (a message id), and only from the webpage to outlook [update]: This is the error: automation server can't create object. We can get around it a bit by turning things off in IE, but thats not a good way to do it! Thanks

    Read the article

  • Why does Windows 7 always automatically change the input or keyboard language?

    - by B-Ball
    I am wondering why Windows 7 always automatically changes my input or keyboard language. I've a notebook with an integrated QWERTY keyboard English (United States). Traveling, I use that one but, additionally, I've my own as well as a much better keyboard at home which is a QWERTZ keyboard German (Germany). Thus, being at home, I'd like to use my QWERTZ keyboard. Unfortunately, Windows 7 does not play along at this one. Every time, I start up my notebook, it is usually set to English (United States) but that's not the problem. In case, I'd use my notebook QWERTY keyboard English (United States), that's fine. However, if I start up my notebook and I'd like to use my QWERTZ keyboard German (Germany), I usually press ALT + Left Shift in order to switch from English (United States) to German (Germany) and Windows 7 switches the input language but only for the program that is currently open. If my input language is set to German (Germany) and I, e.g., open NotePad, Windows 7 automatically switches my input language to English (United States). This is very annoying since I've to change the input or keyboard language to German (Germany) every time I open up a new program. Why doesn't Windows 7 stay with one input language if I changed it manually by pressing ALT + Left Shift? Why doesn't the manual change of the input or keyboard language apply for the whole Windows 7? Why does it only affect the currently opened program? Since I've two keyboards with two different layouts, I seriously need to have both of the keyboards languages installed. I tried both of the below settings in order to find a solution for my problem. Currently, I am using the first option, two input languages. First option: two input languages: Second option: two keyboard languages:

    Read the article

  • Best language on Linux to replace manual tasks that use SSH/Telnet? [on hold]

    - by Calab
    I've been tasked to create and maintain a web browser based interface to replace several of the manual tasks that we perform now. I currently have a "shakey" but working program written in Perl (2779 lines) that uses basic Expect coding, but it has some limitations that require a great deal of coding to get around. Because of this I am going to do a complete rewrite and want to do it "right" this time. My question is this... What would be the best language to use to create a web based interface to perform SSH/Telnet tasks that we would normally do manually? Keep in mind the following requirements: Runs on a CentOS Linux system v5.10 Http will be served by Apache2 This is an INTRANET site and only accessible within our organization. User load will be light. No more that 5 users accessing it at one time. perl 5.8.8, php 5.3.3, python 2.7.2 are available... Not sure what other languages to check for, or what modules might be installed in each language. The web interface will need to provide progress indicators and text output produced by the remote connection, in real time as it is generated. If we are running our process on multiple hosts, they should be in individual threads so that they can run side by side, not sequentially. I want the ability to "trap" on specific text generated by the remote host and display an alert to the user - such as when the remote host generates an error message. I would like to avoid as much client side scripting (javascript/vbscript) as I can. Most users will be on Windows PC's using Chrome or IE as a browser. Users will be downloading the resulting output so they can process it as they see fit. I currently have no experience with "Ajax" or the like. Most of my coding experience is old 6809 assembly, Visual Basic 6, and whatever I can cut/paste from online examples in various languages (hence my "shaky" Perl program) My coding environment is Eclipse for remote code editing, but I prefer stuff like UltraEdit if I can get a decent syntax file for the language I'm using. I do have su access on the server, but I'm not the only one using this server so I can't just upgrade/install blindly as I might impact other software currently running on the machine. One reason that I'm asking here, instead of searching (which I did) is that most replies were, "use language 'xyz', but you need to use an external SSH connection" - like I'm using Expect in my Perl script. Most also did not agree on what language that 'xyz' should be. ...so, after this long posting, can someone offer some advice?

    Read the article

  • Python for a hobbyist programmer ( a few questions)

    - by Matt
    I'm a hobbyist programmer (only in TI-Basic before now), and after much, much, much debating with myself, I've decided to learn Python. I don't have a ton of free time to teach myself a hundred languages and all programming I do will be for personal use or for distributing to people who need them, so I decided that I needed one good, strong language to be good at. My questions: Is python powerful enough to handle most things that a typical programmer might do in his off-time? I have in mind things like complex stat generators based on user input for tabletop games, making small games, automate install processes, and build interactive websites, but probably a hundred things along those lines Does python handle networking tasks fairly well? Can python source be obscufated (mispelled I think), or is it going to be open-source by nature? The reason I ask this is because if I make something cool and distribute it, I don't want some idiot script kiddie to edit his own name in and say he wrote it And how popular is python, compared to other languages. Ideally, my language would be good and useful with help found online without extreme difficulty, but not so common that every idiot with computer knows python. I like the idea of knowing a slightly obscure language. Thanks a ton for any help you can provide.

    Read the article

  • Why is VB6 still so widely used?

    - by Uri
    Note that this question is not meant to start an argument, I am genuinely curious: Back in the 90s I used to work for a large CPU maker and we were building some debuggers. All our core logic was in C++, but the GUI was made in VB6. We couldn't figure out MFC and it was too much a hassle. We glued together VB6 and C++ using COM which we created via ATL. Fast forward to 2009, having been mostly in the Java world I am looking at job boards and seeing more VB6 jobs than I expected. I genuinely thought that VB6 was extinct, especially since VB.NET supposedly solved a lot of the problems with the VB6 which at the time felt a lot like a scripting language than a true OOP language. So what happened? Why is new code still written in it? Isn't there a better way to glue C++ and VB.NET? Note that I haven't used VB.NET, I just understand that it is a much more "stricter" language than VB6 was. Even with Option Explicit or whatever it was.

    Read the article

  • How large a role does subjectiveness play in programming?

    - by Bob
    I often read about the importance of readability and maintainability. Or, I read very strong opinions about which syntax features are bad or good. Or discussions about the values of certain paradigms, like OOP. Aside from that, this same question floats about in my mind whenever I read debates on SO or Meta about subjective questions. Or read questions about best practices and sometimes find myself or others disagreeing. What role does subjectiveness play within the programming realm? Sometimes I think it plays a large role. Software developers are engineers in a way, but also people. A large part of programming is dealing with code that's human readable. This is very different from Math or Physics or other disciplines with very exact and structured rules. Here the exact structure and rules are largely up in the air, changeable on a whim, and hence the amount of languages in existence. And one person may find one language very readable, and another person may find their own language the most comforting. The same with practices. One person may not like certain accepted practices. I myself find splitting classes into different files very unreadable, for instance. But, I can't say rules haven't helped in general. Certain practices have and do make life easier. And new languages have given rise to syntax and structure that make life easier. There's certainly been a progression towards code that is easier to read and maintain even given a largely diverse group of people. So maybe these things aren't as subjective as I thought. It reminds me, in a way, of UI design. Certainly it's subjective, but then there's an entire discipline involved in crafting good UI and it tends to work. Is there something non-subjective about the ideas behind maintainability, readability, and other best practices? Is there something tangible to grasp when one develops a new language or thinks of new practices?

    Read the article

  • C/C++ Control Structure Limitations?

    - by STingRaySC
    I have heard of a limitation in VC++ (not sure which version) on the number of nested if statements (somewhere in the ballpark of 300). The code was of the form: if (a) ... else if (b) ... else if (c) ... ... I was surprised to find out there is a limit to this sort of thing, and that the limit is so small. I'm not looking for comments about coding practice and why to avoid this sort of thing altogether. Here's a list of things that I'd imagine could have some limitation: Number of functions in a scope (global, class, or namespace). Number of expressions in a single statement (e.g., compound conditionals). Number of cases in a switch. Number of parameters to a function. Number of classes in a single hierarchy (either inheritance or containment). What other control structures/language features have limits such as this? Do the language standards say anything about these limits (perhaps minimum requirements for an implementation)? Has anyone run into a particular language limitation like this with a particular compiler/implementation? EDIT: Please note that the above form of if statements is indeed "nested." It is equivalent to: if (a) { //... } else { if (b) { //... } else { if (c) { //... } else { //... } } }

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >