Search Results

Search: Posts Made By: ShawnMilo
4,283
Posted By ShawnMilo
If you want the last line, use: tail -n 1 ...
If you want the last line, use:

tail -n 1

How you pull the record from a specific position depends on how the record is delimited and what tools you have available (sed, awk, Perl, etc.).
27,410
Posted By ShawnMilo
set expandtab Also, set that in your .vimrc...
set expandtab

Also, set that in your .vimrc file for more convenience.

Here is what I use:

set nu
set tabstop=4
set shiftwidth=4
set autoindent
set expandtab
5,439
Posted By ShawnMilo
I suggest you look up "PHP tutorial" on Google,...
I suggest you look up "PHP tutorial" on Google, find a simple example of reading values from the $_POST object, and write some code. It doesn't matter if you get it working perfectly; you can post...
1,597
Posted By ShawnMilo
It sounds like you might want to look into rsync...
It sounds like you might want to look into rsync instead.

For command-line FTP, I prefer ncftp very much. It has a recursive mget, which your vanilla ftp may not.
25,025
Posted By ShawnMilo
#!/usr/bin/env python for line in...
#!/usr/bin/env python

for line in open('temp.txt', 'r'):
seen = []
words = line.rstrip('\n').split()

for word in words:
if not word in seen:
print word,
...
9,802
Posted By ShawnMilo
If you look at the output of od -c, you'll notice...
If you look at the output of od -c, you'll notice that it has a backslash followed by an n, with a space between them. Then a \n with no space.

If you want to literally append a newline character...
28,502
Posted By ShawnMilo
The opposite -- +72 will give you things modified...
The opposite -- +72 will give you things modified more than 72 hours ago, -72 would be less than 72 hours.
16,623
Posted By ShawnMilo
Maybe something like this: echo "LOAD DATA...
Maybe something like this:

echo "LOAD DATA LOCAL INFILE '/path/to/inbounddata/data/$(date +%Y-%m-%d)/traveldata.csv'" | mysql -u yourname -p

Try this alone first to judge the output:

$ echo...
28,502
Posted By ShawnMilo
If you want stuff from within the last hour, use...
If you want stuff from within the last hour, use -1. If you want stuff less than five hours old, use -5. If you want to control the time by minutes instead of hours, use mmin instead.
10,999
Posted By ShawnMilo
Try mmin. In any case, check the manual on your...
Try mmin. In any case, check the manual on your system for find to see what options you have.

Also, if you're looking for files exactly six hours old, you may not find any. You may need to do...
2,406
Posted By ShawnMilo
If you already know how to use "find" to get all...
If you already know how to use "find" to get all the files from a date, just use the "-exec" flag and cat each file onto your big file.

The only gotcha is that you'll want to be sure (by naming...
7,623
Posted By ShawnMilo
If they have the same timestamp, then what else...
If they have the same timestamp, then what else would you sort by?

Also, I realized that the timestamp isn't reliable anyway, because when you roll over from December to January, the December (12)...
16,623
Posted By ShawnMilo
You can create a 'LOAD DATA INFILE' query and...
You can create a 'LOAD DATA INFILE' query and place it in the ".sql" file (the name is irrelevant). This is what I meant earlier, but I didn't specify that because I mistakenly thought your first...
16,623
Posted By ShawnMilo
Another easy option is to save your SQL query...
Another easy option is to save your SQL query exactly as you would type it an the MySQL prompt in a text file, then:

mysql -u yourname -p < myquery.sql

If you can specify the filename in the...
7,623
Posted By ShawnMilo
CTRL + C will kill it, just like anything else....
CTRL + C will kill it, just like anything else. You're welcome. A megabyte isn't too big, so that shouldn't be too much of a burden on the machine.
7,623
Posted By ShawnMilo
Does this help? $ cat temp.txt | sort |...
Does this help?

$ cat temp.txt | sort | tail
03/11/09 14:55:00 hahahaha <=== will be overwritten next
03/11/09 14:57:00 i c ded p'pl
03/11/09 14:59:00 l8terz <=== end of circular file (wrap...
7,623
Posted By ShawnMilo
Are there timestamps in the file? Please...
Are there timestamps in the file?

Please post an excerpt containing a section where the wrap over happens.
8,793
Posted By ShawnMilo
What do you mean by "union"? Do you just want the...
What do you mean by "union"? Do you just want the contents of both files together in one file? If so, just use cat.

cat file1 file2 > file3

Do you want a file containing only the lines that are...
16,623
Posted By ShawnMilo
Sure you do. If you're writing a shell script,...
Sure you do. If you're writing a shell script, have the script rename it. Of course you can always use a programming language to do the inserts, but it's probably going to be less efficient.
16,623
Posted By ShawnMilo
No, you have to rename the file to match the...
No, you have to rename the file to match the table. That's just the way mysqlimport works.
2,338
Posted By ShawnMilo
The second and third lines you list are identical...
The second and third lines you list are identical in function. The "m" (for match) is optional.

The =~ assigns the result of a regex subsitution to the variable. If you're doing a match, it...
8,831
Posted By ShawnMilo
They're probably the same, and you should...
They're probably the same, and you should probably use ssh due to the fact that telnet sends information in plain text.
16,623
Posted By ShawnMilo
On the command line, you can just use...
On the command line, you can just use mysqlimport. It's the direct equivalent of the command you want to run, and takes the same arguments.

If you're familiar with sqlldr for Oracle, it works in a...
2,510
Posted By ShawnMilo
fgrep -f file1 file2
fgrep -f file1 file2
Forum: Infrastructure Monitoring 03-10-2009
1,928
Posted By ShawnMilo
Your description is a little confusing. Do you...
Your description is a little confusing. Do you need to alter the second word, the second line, or the second word on the second line?

In any case, you can do this very simply with a Perl one-liner...
Showing results 1 to 25 of 236

 
All times are GMT -4. The time now is 11:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy