I'm using grep to generate a list of files I need to move:
grep -L -r 'Subject: \[SPAM\]' .
How can I pass this list to the mv command and move the files somewhere else?
Say I have an environment variable myvar
myvar=\tapple\n
when the following command will print out this variable
perl -e 'print "$ENV{myvar}"'
I will literally have \tapple\n, however, I want those control chars to be evaluated and not escaped. How would I achieve it?
In the real world $ENV residing in substitution, but I hope the answer will cover that.
I wonder how to list content of tar file only down to some level?
I understand "tar tvf mytar.tar" will list all files, but sometimes I wish I can just see directories down to some level.
Similarly for command "ls" how to control the level of subdirectories that will be displayed? By default, it will only show the direct subdirectories, but not further.
Thanks and regards
I'm loading a rather large swf as style with the following command:
StyleManager.loadStyleDeclarations("assets/modules/"style.swf",true,false,ApplicationDomain.currentDomain);
The style is loaded fine but now I would like to add a progress bar to it, but I do not know how to do so. I am rather new to Flex and found only examples referring to HTML service calls.
Thank You for Your Help. It would be great to receive a small code example.
Db connectivity is handled by an include.
I want to run this command:
mysql_close($con);
Only if we currently have a connection. Something like isset()?
Thanks Hamad
I want to write a command line script using Python to access a user's Facebook Notes.
PyFacebook wrapper library doesn't have support for Facebook notes.
Is there any other way I can do this in python? I don't want to learn PHP.
My config file is really just a big python dict, but I have many config files to run different experiments and I want to 'import' a different one based on a command line option. Instinctively I want to do import ConfigFileName where ConfigFileName is a string with the config file's python package name in it... but that doesn't work.
Any ideas?
I am using OleDB for executing my queries in C#,
Is there any way I can execute multiple queries in one command statement?
I tried to separate them with semi-colon (;) but it gives error "Characters found at the end"
I have to execute a few hundreds of queries at once.
I want to move all the files to a new dir. From the command line I can do "mv . newdir" but if I try with this script:
#!/bin/bash -f
#
mkdir newdir
mv *.* newdir
I get the following message: "mv: rename . to newdir/.: No such file or directory"
Just wondering if its possible to set a default tablespace in postgres to keep indexes. Would like the databases to live on the default tablespace for postgres, however, would like to get the indexes on a different set of disks just to keep the i/o traffic separated.
It does not appear to me that it can be done without going in and doing an ALTER index TABLESPACE command, and then the index is moved and will stay there, but the databases and indexes are part of a django app, so non-django intervention can cause some problems.
I have a client server situation in which I receive data using
read(socket, char_buf, BUF_SIZE)
and then try to write it into a log file using
write(filefd, char_buf, strlen(char_buf))
Strangely enough this fails (write returns -1), and yet the errno is set to 0, and I can print the message, AND the log file descriptor works (I write to it before and after this command).
What's going on??
(Working on Linux kernel 2.4 (homework))
Follow up to this question
This (similar version from old link) works in SQL Server 2008, however, Oracle is giving me trouble:
MERGE INTO wdm_test
USING ( select '10000000000000000000000000000000' Guid from DUAL ) val
ON ( wdm_test.Guid = val.Guid )
WHEN MATCHED THEN UPDATE SET test_column = null
WHEN NOT MATCHED THEN
INSERT (Guid, test_column)
VALUES ('10000000000000000000000000000000', null)
OUTPUT $action;
SQL Error: ORA-00933: SQL command not properly ended
Does Oracle not support OUTPUT $action;? If not, is there an alternative?
I have this code
$("body").on({
click: function(event){
event.preventDefault();
var aLink = $(this).attr("href");
$("#content").load(aLink+" #loader", function(){
//Callback here
});
$("#crumbbar").load(aLink+' .breadcrumbs', function(){
//Callback here
});
}
}, "a");
Can this be optimized in such a way that I only have 1 load command?
A little help from you all...
I was trying to convert a simple java program into jar but nothing seems to have happened.
I have 2 files: Tester.java , Tester.Class.
Then I used this command line:
jar -cvf Tester.jar Tester.class
The .jar file was created but nothing seems to work.
What did I miss?
How do I kill a process which is running in bash - for example, suppose I open a file:
$ gedit file.txt
is there any way within the command prompt to close it? This example is fairly trivial, since I could just close the window, but it seems to come up a bit, particularly when I mistype commands.
Also is there any way to escape an executable which is running? This probably has the same solution, but I thought I'd ask anyway.
Thanks
I'm trying make a lists difference. Found directly prelude operator \\\\ that makes lists difference. But errors Not in scope: '\\\\' occurs. Here is my simple from command line interpreter:
Prelude> ([1,2,3] ++ [5,6]) -- works like expected
[1,2,3,4,5,6]
prelude> ([1,2,3] \\\\ [1,2]) -- erros occurs
<interactive>:1:11: Not in scope: "\\\\"
Thanks for explanation where I make a mistake.
I am using Solaris. I have to log into sql plus and run some queries, which give a huge result set.
I want to copy all that into a file. Is there any command for it in unix or sqlplus ?
A show create table command shows the following:
'columnA' varchar(6) NOT NULL DEFAULT '';
How do I modify that column so that the not null is removed?
I need it to be:
'columnA' varchar(6) DEFAULT NULL;
I thought the following would work, but it has no effect:
ALTER TABLE tbl_name MODIFY columnA varchar(6) DEFAULT NULL;
Hey guys I need to send the content of an NSMutableArray through email. I have a mailing function but I'm not sure on how to place the content of the array into a NSString to be displayed on the email under each other. Is there a way to place all the content of the array into the string with maybe HTML nextline command between each array element?
NSString *emailBody = @"Need to put the body here";
Thanks
I have some code from a function
subl $24, %esp
movl 8(%ebp), %eax
cmpl 12(%ebp), %eax
Before the code is just the 'ENTER' command and afterwards there's an if statement to return 1 if ebp eax or 0 if it's less. I'm assuming cmpl means compare, but I can't tell what the concrete values are. Can anyone tell me what's happening?
I am trying to make a little application to allow to record actions within a Flash and Silverlight application. In such manner that you can compile your interactive application in test-mode and then be able to click on elements which then passed the action to Selenium IDE which then adds this command to the testcase.
I am curious if this even possible and how I can achieve this in Firefox?
I wonder how to list the content of a tar file only down to some level?
I understand tar tvf mytar.tar will list all files, but sometimes I would like to only see directories down to some level.
Similarly, for the command ls, how do I control the level of subdirectories that will be displayed? By default, it will only show the direct subdirectories, but not go further.
I just ran a command
update sometable set col = '1';
by mistake without specifying the where condition.
Is it possible to recover the previous version of the table?
This is either trivial or runs counter to the philosophy of how make should be used, but I'd like to have a command line that reads as "make debug" rather than "make DEBUG=1". I tried creating a phony target called debug that did nothing except set the DEBUG variable, but then there was a difference between "make debug build" and "make build debug"--namely that in one case, the variable got set after the build happened.
Is there a way to give certain targets precedence?
Thanks for your help.
I'm developping a web application in Eclipse and I'm using maven, spring and tomcat.
Now the problem I have is that debug as = debug on server doesn't work.
I just get exceptions. (and yes I've created the server)
If I use the mvn command to compile it, put the war in my tomcat webapps dir and start my tomcat the application works fine. But for the functionallity I'm now working on debugging would be usefull.