General :: How To Program The Command Line To Run A Piece Of Code Multiple Time
Dec 4, 2010
So, I usually write/find a test case generator for any code that I write. This type of code generally leads to some file output. To be thorough, I try and generate many different files to test my code on.
Say the command is like this:
Is there a way to automate this for many different values of the parameters and generate many different files?
I wasn't able to use the $i in the filename, and without it the command gave me no errors, but did nothing else either. I know the Unix command line is very powerful, and I have a feeling that this should be possible, but I just don't know how to do it.
Is there a program I can install and run from the Command Line that will hibernate the computer (pausing all running programs (like my Minecraft server)), cutting power usage TO A BARE MINIMUM, and the un-hibernate after a set time? The laptop this will be used on is SliTaz linux with the GUI disabled (unless i run startx)
I thought this question's best category would be in the newbie sectionBasically I have a C code, (for simplicity is only prints a few lines), called printx.c that I would like to convert into a binary file so whenever I have to type "printx" in the command line it would execute the programofcourse gcc will give me a binary file if I do a "gcc printx.c", but even the output file (e.g. print.outwould have to be executed following manner./print.outI only ask, because I notice programs like mailx (which is written in C) is a binary file that could be run in this manner (at least that's what I notice on my ubuntu distro)
I have an older computer with Arch installed that I want to use to accomplish most of my daily tasks using the command-line (Mailgrab, IRSSI, mpg123, Elinks, Vi, etc). I realize that there are many lightweight WMs out there that support multiple monitors, but it'd be nice if I could just use Screen or something to that effect to distribute my windows across two or three displays.
I am using ubuntu and mysql.I have a list of many .sql files, like 1.sql, 2.sql, 3.sql ... 100000.sqlI need to insert them into the database mysql mydb < *.sqlGives me: -bash: *.sql: ambiguous redirect
I want to take a graphics file and make 10 copies of it to the same directory, each with 001, 002, or some such designation at the end of each file name so they have discrete files names. Is this possible using cp?
For whatever reason, the "Ctrl-Alt-Fn" sequence has no effect on one of my Ubuntu machines; the sequence is interpreted as ordinary input. I need to get the system to a console because I'm trying to do a dist-upgrade and that's going to bounce gdm etc.
Is there some command-line tool that can be used to switch consoles? I have some vague distant memory of that being possible.
(I'm running Ubunty Jaunty at the moment. Yes I know it's old; I'm trying to march forward.)
I'm sick of screwing around trying to script a clean solution to burn multiple files and folders to CDs and DVDs with wodim, growisofs and genisoimage.I'm looking for a high level command line program that uses sensible defaults and takes arguments something like this:[program-name] [cd|dvd] /path/to/dir1/ /path/to/dir2/ /path/to/file ...It should then do all the low level copying and ISO generation transparently and just burn the damn disk!Does anyone have any suggestions? I've looked at several programs but it seems there are too many choices to trawl through and not enough information about them online.
OS: CentOS 5.3 Enterprise Server Red Hat Nash Version 184.108.40.206
I need to find a command-line program to randomly change my MAC address. I know on Ubuntu there is a program called 'macchanger'. And on Windows another one called 'macshift'. I just can't find one for CentOS 5.3 Enterprise Edition.
I'm still a but confused about the standard way of removing it for left-associative operators: [URL] Especially about how to construct an AST from it by executing a peice of code for every nonterminal matched. And I'm still not totally convinced that it will be left-associative, I just barely understand it. Also, how would you remove left-recursion for something like this:
Code: expr ::= expr "(" param_list ")" | other stuff...?
I'd like to measure network latency for SNMP GET request. There is a free command line tool time which can be used to find timing statistics for various commands. For example it can be used with snmpget in the following way:$ time snmpget -v 2c -c public 192.168.1.3 .220.127.116.11.18.104.22.168.1.10.2IF-MIB::ifInOctets.2 = Counter32: 112857973real 0m0.162suser 0m0.069ssys 0m0.005sAccording to the manual, statistics conists of:
the elapsed real time between invocation and termination, the user CPU time (the sum of the
I have just installed pdfocr. Unfortunately it does not have a gui and so in time I will forget how to use it or not remember I have it.
Is there a simple generic program that will browse to where the file is and then run the command line? I suspect python will do it. Could someone point me to a suitable tutorial for this purpose.code...
I am going to do a web based search for several thousand webpages which may or may not exist. I just want a list of the addresses which work. I dont want to load into firefox, and I'd preffer not to ping the url. I just want to test the URLs for validity and kick back a list of good URLs. Any Ideas on a simple program to do this, which I can use in a bash script?
I decided to install Chromium OS to my dad's netbook, and it works perfectly. The only problem is that i can't change the time. Luckily, I can access a command line by pressing CTRL+ALT+T. So maybe I can change it from the command line.
command line, I have a server for work that I ssh into and I need to be able to find multiple files (they have the leading text just the date identifier changes) and then zip the files (with bzip) them and then finally scp(Secure copy) them to another server.
These files are always in the same directory and this is a daily task and just want to make into a script that I run once I am logged into the remote server.
I liked the idea of the "cosmos" screensaver/desktop, but wanted to add my own pictures to the application. I navigated to /usr/share/backgrounds/cosmos and tried to drag and drop. I quickly found that I did not have permission to do this.
I googled my problem and found some command line tutorials telling me to sudo cp. My problem is that I have about 30 pics that I want to move in there, and I don't think I can just move the directory, they have to be in that folder as the pictures themselves.
I don't really feel like typing the cp line multiple times with multiple randomly named image files.
Is there a way to have the command line cp all of my files from one directory to another?