159 Posted Topics

Member Avatar for coding101

Would SELinux help in this case? Here's an old post from the fedora mailing list that might help: [url]http://www.redhat.com/archives/fedora-selinux-list/2004-October/msg00125.html[/url]

Member Avatar for thekashyap
0
156
Member Avatar for deni_bg

Not knowing much about your system, it's nearly impossible for us to tell what effect deleting that file might have. That being said, if that file is (was?) indeed a *core dump*, then losing it is probably not a problem. Core files are full of diagnostic information written to disk …

Member Avatar for L7Sqr
0
164
Member Avatar for Staric

Hi Staric! I see a couple of potential issues here. I think the real answer lies in your "mirror" command. I'm not familiar with a 'mirror' command, so is it safe to assume that's a script? Could you paste that script here as well? If the problem is that it's …

Member Avatar for JeoSaurus
0
231
Member Avatar for voidyman

Hello voidyman! I'm not sure about kicking off a process via FTP, but if you have cron access you might get better results running a shell script from cron that checks for that file, and does the work if it exists.

Member Avatar for voidyman
0
104
Member Avatar for dappe

For the second problem, you can use re.search, with a fairly simple regex. Something like this should do: [engi]{4} That will match a lot of words that don't have ALL four of those letters though. You can probably refine it form there if needed.

Member Avatar for TrustyTony
0
8K
Member Avatar for harsimran05

Hello! You may want to try using "MM" in your date string to represent the month, rather that "mm" which represents minutes ;) [code]SimpleDateFormat("dd-MM-yyyy")[/code] From the java documentation: [code]M Month in year Month July; Jul; 07 m Minute in hour Number 30[/code]

Member Avatar for JeoSaurus
0
97
Member Avatar for perly

Hello perly! It looks like you're close! Since you didn't post what you perceive as the problem is with your script, I'm just guessing as to the solution here :) Why not do it all line-by-line though? Something like this might work: [code] my $REPORT_FILE = 'report.txt'; my $allRfile = …

Member Avatar for perly
0
116
Member Avatar for shwick

Hi Shwick! "I tried adding in a www entry but it only resolves to the same local ip as example.com" ^This is the expected behavior here. On the web server side of things, you would want to make sure that apache (or your web server of choice) resolves both example.com …

Member Avatar for JeoSaurus
0
232
Member Avatar for Who me?

Hello Who?! Does something like this help? [code]<?php // set $a to house here: $a = "house"; // set $c to the php code we want, using // $a as a variable: $c = "<?php \$b = \"$a\"; ?>"; // echo $c to see what out output looks like! echo …

Member Avatar for Who me?
0
163
Member Avatar for jam2010

Hello jam2010, welcome to the forum! Could you show us what you have tried so far? We might be able to help you get it to work, but I don't know that anyone here will write a script to spec from scratch. Thanks! -G

Member Avatar for JeoSaurus
0
87
Member Avatar for Sudo Bash

Hi Sudo! I've done something similar before to monitor a log for errors, and execute commands based on what it found. Here's an example: [code]#!/bin/bash logfile="/var/log/messages" pattern="ERROR.*xxx" tail -fn0 $logfile | while read line ; do echo "$line" | grep "$pattern" if [ $? = 0 ]; then echo "$line" …

Member Avatar for Sudo Bash
0
259
Member Avatar for Digitalwolf

That's interesting! If you can run that from the command line, it *should* work in a script as well... Perhaps try using the full path to 'java' and the full path to the Test.jar?

Member Avatar for Digitalwolf
0
210
Member Avatar for Borzoi

rsync! Do some thing like [icode]rsync -av --delete-after /home/folder1/subfolder/ /home/folder2/subfolder[/icode]. I *think* that will do what you're looking for!

Member Avatar for JeoSaurus
0
210
Member Avatar for k2k

Hi k2k! Were you able to figure this out? Personally I've found that using keys for authentication is much more reliable (and possibly more secure?) than using passwords in scripting tasks like this. Is that an option in your case?

Member Avatar for maninaction
0
546
Member Avatar for k2k

k2k, This sounds similar to what you're asking in your other thread. So you want to match the line TWO down from the first match instead of the one directly below? Will there ever be an 'a=0' between them? like this: #this is y a=0 a=0 where you would want …

Member Avatar for k2k
0
129
Member Avatar for techie929

Hi techie929, I *think* that you are getting an empty file because you are opening the file with ">", which will create a file if one does not exist, or *truncate* the file if it does exist. Therefore, the file is being truncated before you even get to read it …

Member Avatar for anuragmathur1
0
105
Member Avatar for Member24

Hi Member24! It looks like you're running into this feature of awk output redirection: [quote] print items > output-file This type of redirection prints the items into the output file output-file. The file name output-file can be any expression. Its value is changed to a string and then used as …

Member Avatar for JeoSaurus
0
247
Member Avatar for watery87

Hello Watery! Why not just use a simple regex to match the pattern you're looking for? This one works for me, but you might be able to simplify it even more: [code] open FILE, "sample.txt" or die $!; while (<FILE>) { if ( $_ =~ /(http:\/\/www\..*?)\// ) { print $1 …

Member Avatar for JeoSaurus
0
104
Member Avatar for casper1
Member Avatar for Mahendra Jadhav

Hi! Have you looked at File::Copy? This link has information about the File::Copy module, and some examples: [url]http://perldoc.perl.org/File/Copy.html[/url] I hope this helps!

Member Avatar for JeoSaurus
0
78
Member Avatar for amithlaxman

Hi amithlaxman! Have you looked into the [url=http://perldoc.perl.org/functions/fork.html]fork()[/url] function?

Member Avatar for amithlaxman
0
126
Member Avatar for tmparisi

Hi tmparisi! Perhaps you could show us what you've tried so far? Generally FTP requires some interaction, so you might be better off using something like Perl, depending on what you're trying to do, but there's still a lot that can be done in bash!

Member Avatar for JeoSaurus
0
33
Member Avatar for pythonnoobie

Would re.sub work for what you're doing? [url]http://www.regular-expressions.info/python.html[/url] Something like this? [code] #!/usr/bin/python import re import fileinput for line in fileinput.input("test.txt"): print re.sub("(APP[a-z]{2}[0-9]{3})", "<a href=\"\\1\">\\1</a>", line) [/code] Here's a test run: [code] -> cat test.txt APPsd222 APPxx333 -> python test.py <a href="APPsd222">APPsd222</a> <a href="APPxx333">APPxx333</a> [/code] I hope this helps! I'm …

Member Avatar for pythonnoobie
0
241
Member Avatar for SakuraPink

Hi SakuraPink! Sounds like you're making progress! The 'p' at the end is for 'print'. Take a look at the [url=http://unixhelp.ed.ac.uk/CGI/man-cgi?sed]sed man page[/url] for more info about that. If you're using these sed lines in a similar way to your original script, that would explain why the second file is …

Member Avatar for SakuraPink
0
246
Member Avatar for _neo_

Hi _neo_! Just to be sure, can you tell us what language you're working with? There are a couple of ways this might be accomplished, but I wanted to be sure I'm testing with the correct base syntax file first. Thanks! -G

Member Avatar for _neo_
0
262
Member Avatar for yli

Hello yli! Are you trying to replace values or strings? In your example, you're using str_replace() which gives us interesting results. For instance: "portocala" becomes "portoc<b>ala</b>" For THIS example, I'll assume that's what you're expecting! :) You can replace your new_kw/old_kw logic with a simple loop, which will loop through …

Member Avatar for diafol
0
131
Member Avatar for machine91

Hello machine91! Take a look at python's "csv" module. I believe it will give you what you need. I'm a python noob, but here's a basic example that does something close to what I think you're looking for: [code] #!/usr/bin/python import csv csvInput = csv.reader(open('test.txt', 'rb'), delimiter=' ') count = …

Member Avatar for JeoSaurus
0
3K
Member Avatar for sid78669

Hello Sid! I don't think there's a way to accomplish this with pure PHP. If cron is available on the server (if it's a unix/linux system, or task scheduler if it's Windows), that's probably the way to go. I hope this helps! -G

Member Avatar for sid78669
0
164
Member Avatar for sjgriffiths

Hi all! This can be done with a fairly simple one-liner! As Salem pointed out, all the clues are in the man page, but I personally found the solution in 'sort' rather than 'uniq': [code] # The test file with your sample data -> cat test.txt REF | FOR | …

Member Avatar for JeoSaurus
0
303
Member Avatar for anjoz

Hello anjoz! 'readlink -f' will give you the full path to a filename, but I'm not sure how to overcome the issue of storing those in a text file if there's more than one file with the same name. I think a better solution might be to either store the …

Member Avatar for JeoSaurus
0
364
Member Avatar for Diwakar Gana

Hello Diwakar Gana! I'm not 100% sure of the answer, but it looks like there is a related discussion over at perlmonks: [url]http://www.perlmonks.org/?node_id=839304[/url] I hope this helps! -G

Member Avatar for Diwakar Gana
0
693
Member Avatar for Freude

Hi Freude! The ">" basically just re-directs output. In this case, the result of: [icode] echo "pause 1; replot; reread;" > loop_forever.gnu [/icode] would be a file named 'loop_forever.gnu' with the stuff in quotes as the content of the file. It looks like .gnu is an extension to indicate that …

Member Avatar for Freude
0
123
Member Avatar for santhoshvkumar

Hello santhoshvkumar! I do not believe that there is a way to run a bash command from inside MySQL. What you MIGHT be able to do though is run a bash script from cron that will check for a flag in mysql, and act based on that. I hope this …

Member Avatar for JeoSaurus
0
88
Member Avatar for AMANSEHJOWAL

Hi! The Linux Documentation Project is one way to start: [URL="http://tldp.org"]http://tldp.org[/URL] There's a good introduction to Linux here: [URL="http://tldp.org/LDP/intro-linux/html/index.html"]http://tldp.org/LDP/intro-linux/html/index.html[/URL] There are lots of places to go from there. My best advice is to just install it and find something that you want to do with it. Configuring and maintaining a …

Member Avatar for linux.obeardly
-1
78
Member Avatar for whizkidash

Whizkid: I think we might need more context... If I had to guess, "CheckRetStat" is probably a function, defined elsewhere in the script. verdascofernan: I'm not sure what you mean, but it doesn't appear to be related to this thread, so you might have better luck starting a new thread …

Member Avatar for thekashyap
0
128
Member Avatar for fuggles

Hi fuggles! I'm not sure what you mean by "Live USB", but take a look at "unetbootin" [url]http://unetbootin.sourceforge.net/[/url] You should be able to use unetbootin to get a bootable USB image from the dvd iso. I hope this helps! -G

Member Avatar for 84hd0ns
0
119
Member Avatar for tuse

You could always just echo the command before it's run, then run it. You could even put a prompt in there if you really wanted. [code]#!/bin/sh prompt="<<root@server ~>>$ " for command in "ls" "cd /tmp" "ls"; do echo "$prompt $command" $command done[/code] Sample output: [code]$ sh tmp.sh <<root@server ~>>$ ls …

Member Avatar for shibblez
0
2K
Member Avatar for wapcrimers

Hi wapcrimers, There isn't reall an "uninstall" for Linux. How was it installed on this machine? Is it on a separate disk or partition? It also might help to know what kind of problem you are experiencing. Based on the information you've provided so far, all we can really do …

Member Avatar for wapcrimers
0
272
Member Avatar for winky

Hmm... I'm not familiar with the 'nlst' command. What happens if you use 'ls' instead? For me, 'ls' gives me a directory listing, neatly stored in @filenames.

Member Avatar for JeoSaurus
0
556
Member Avatar for kukuruku

Hi kukuruku! I believe you're looking for this: [icode]$#argv[/icode] Check out this link for more details! [url]http://www-cs.canisius.edu/ONLINESTUFF/UNIX/shellprogramming.html[/url] I hope this helps! -G

Member Avatar for JeoSaurus
0
55
Member Avatar for kavithanb

This sounds interesting Kavitha! What have you tried so far? Do you have any example text so that we can see what the log looks like? I worked on something similar recently, but I didn't go as far as getting the entire stack trace (that part might be a little …

Member Avatar for JeoSaurus
0
104
Member Avatar for suman.great

Hi suman.great! Here's a line from the 'expr' man page that relates to the problem that you're having: [icode]Beware that many operators need to be escaped or quoted for shells.[/icode] You can work around this simply by quoting your variables. I tested this with your sample data and this script: …

Member Avatar for suman.great
0
171
Member Avatar for medaugh

Expect is definitely the way to go... OR you could generate a list of files first (store them in a variable or temporary file), and use ncftpput to do the work, no expect or << required!

Member Avatar for JeoSaurus
0
628
Member Avatar for madtorahtut

Hi madtorahtut! Have you tried [URL="http://www.samba.org/rsync/"]rsync[/URL]? Rsync does exactly what you're describing, with a very simple command line. Here's an example... If you want to have /data/ on Server A sync'd with /data/ on Server B (deleted files are deleted, changed files are changed, etc...) you would do something like …

Member Avatar for JeoSaurus
0
149
Member Avatar for brick79

Awk would be great for this too, especially if the message is in the same 'field' every time. For instance, in your example text, your 'short_message' is in the second field (after the first comma). Something like this would do the trick: [icode]awk -F, '/short_message/ {split ($2,A,"="); print A[2]}'[/icode] In …

Member Avatar for JeoSaurus
0
101
Member Avatar for Syphilis

This post is 2 days old, so I hope this helps... There are some commands that are actually made for this! Try "host" or "nslookup". Your results will be much faster and easier to parse than ping. -G

Member Avatar for JeoSaurus
0
144
Member Avatar for vasuv

Hi Vasu! That certainly sounds possible. I think we might need a little more information though. Perhaps some sample data, and which columns you want to get these values from?

Member Avatar for griswolf
0
346
Member Avatar for ddndd
Member Avatar for Moncky

Hi Moncky, This is something I've been interested in too, and until recently there hasn't been any real "standard" to go by. With as much RAM as you can get into a machine these days, the recommended swap size varies wildly depending on how the machine will be used. After …

Member Avatar for JeoSaurus
0
174
Member Avatar for ammayi67

Is that output from 'who'? It looks more like the 'w' command. The only problem with the straight sed approach above is that you're going to end up with a lot more commas than you expect. You probably don't want commas in the "WHAT" column between commands and arguments and …

Member Avatar for JeoSaurus
0
2K

The End.