- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 6
- Posts with Upvotes
- 5
- Upvoting Members
- 5
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Unix sysadm for more years than I'll admit to.
42 Posted Topics
Re: You know the answer already. What's the difference between the two occurences of $string? | |
Re: Instead of loading the fields into seperate arrays why not load them into an array of structs? | |
Re: Have you looked at this? [Click Here](http://technet.microsoft.com/en-us/library/ff182326%28v=ws.10%29.aspx) | |
Re: SSH - secure shell. Telnet is generally considered to be 'a bad thing' as the username and password are not encrypted. Try PuTTY, available from http://www.chiark.greenend.org.uk/~sgtatham/putty/ | |
Re: Strange. It works for me using GCC and Linux. puts("Before update"); system("hexdump -C data.file"); f=fopen("data.file", "r+"); while(fread(&payment, recsize, 1, f) == 1) { payment.pay=7; fseek(f, -recsize, SEEK_CUR); fwrite(&payment, recsize, 1, f); } fclose(f); puts("After update"); system("hexdump -C data.file"); I've used 7 instead of 1 so that the update is easier … | |
Re: Let's see what you've got so far. | |
Re: A few quick thoughts - The first two lines of the script look like this [CODE]æ²utxtåÖ#!/usr/bin/perl ##############################################################################[/CODE] Are the characters before the hash (#) in the first line actually in the production version of the script? If so, they need removing. Is PERL /usr/bin/perl? Is the script executable? | |
Re: Because what you think is happening isn't. The comparison is carried out left to right : Result z>=y 4>=4 1 (TRUE) 1>=x 1>=3 0 (FALSE) hence the result of 0 | |
Re: [CODE]cat file | awk -F, '{printf("%-1s %2s %2s %2s %2s %2s\n", $1+0, $2+0, $3+0, $4+0, $5+0, $6+0)}'[/CODE] | |
Re: In lines 26 and 27 you're casting a string to a long. What you probably mean to do is [B]convert [/B]the string to a long. I think you'll find that atol() is what you need. The reason that there a no error is that it's doing what you asked for … | |
Re: There are so many problems with this script I don't know where to start. I tried to correct it and came to the conclusion that it would be easier to rewrite it from scratch. Have a look at a AWK tutorial - [URL="http://www.grymoire.com/Unix/Awk.html"]http://www.grymoire.com/Unix/Awk.html[/URL] seems to cover the basics pretty well. | |
Re: Have a look at this, which covers the basic pretty well [URL="http://web.cs.wpi.edu/~rek/DCS/D04/UnixFileSystems.html"]Unix Filesystem Organization[/URL] | |
| |
Re: What do you mean, "did not work"? | |
Re: Put [CODE]set -xv[/CODE] as your second line. You can now see what is happening as it executes. A clue - [CODE]plus $i[/CODE] doesn't do what you think it does. | |
Re: Google windows forwarding. | |
Re: What does your code look like with the averaging code added? | |
Re: To find the size of file - open file fseek to end ftell will give you the size. | |
Re: Don't set DISPLAY, putty does this as it connects, typically to localhost:10.0 | |
Re: Neither, they're both correct. A tar file contains metadata as well as the original data, so if the metadata doesn't match then the checksums won't. If you look on wikipedia for tar(file format) you'll see that the metadata includes stuff like creation data fro both the files and the tarball | |
Re: You're right, the problem is that test only does integer comparisons. How about [CODE] #!/bin/bash i=10 while [ $i -le 30 ] do i=`echo "$i + 5" | bc` j=$(echo "scale=1; $i / 10" | bc) echo "i=$i j=$j" done [/CODE] and use j instead | |
| |
Re: It's line 18 [CODE] chptr = strchr(buf, "\n");[/CODE] "\n" is a string, hence a pointer, rather that an integer. if you change it to [CODE] chptr = strchr(buf, '\n');[/CODE] that should fix it | |
Re: It's because gmail uses SSL for POP3. Take a look at this - [URL="http://forums.devshed.com/perl-programming-6/how-to-get-gmail-mail-by-mail-pop3client-in-perl-555889.html"]http://forums.devshed.com/perl-programming-6/how-to-get-gmail-mail-by-mail-pop3client-in-perl-555889.html[/URL] | |
Re: [CODE]http://search.cpan.org/search?query=WriteExcel&mode=all[/CODE] I've successfully used Spreadsheet::WriteExcel in the past. | |
Re: It should be [CODE]count=$(($count+1))[/CODE] | |
Re: It's because when bash creates a subshell for the pipe. A new variable is created in this subshell, updated on each iteration and then discarded when the subshell terminates. The simplest answer is probably to use ksh. | |
![]() | Re: This may be of use - it normally works for me. First plug in the USB device and check that it has been seen. [CODE] [shibblez@server mnt]$ dmesg usb 1-5: new high speed USB device using address 12 scsi9 : SCSI emulation for USB Mass Storage devices Vendor: SanDisk Model: … |
Re: Modify the scripts to write to syslog using logger. You can then configure syslogd (syslog.conf) to redirect these messages to the console. | |
Re: You should be using the account password for user1, not the root password. As for connecting as root noramlly ssh is configured to reject root logins via ssh. | |
Re: Add [CODE]or die $![/CODE] to the end of line 14. This will show what error, if any, is being encountered on the open. | |
Re: I'm assuming that all of plots are identical. First you need to set up a template file containg the command for gnuplot like this. [CODE]# template.gnuplot set term png set output "OUTFILE" plot "DATAFILE" using 1:2 with lines \ "DATAFILE" using 1:3 with lines [/CODE] Now you can plot the … | |
Re: In your example does /proj/xy already exist? What error are you getting? | |
Re: For reasons I can't fathom basename doesn't appear to work with xargs, even though the {} [B]is[/B] correct. The command below works for me, but I haven't dealt with the case where the filename has spaces in it. [CODE] [B]bash syntax[/B] find . -iname "*.mp3" -printf "%p /mnt/sda1/tmp-zik/%f\n" | xargs … | |
Re: [CODE]lynx -dump http://aaa.bbb.ccc > text.txt[/CODE] | |
Re: Use backquotes ` rather than single quotes. | |
Re: [CODE] x=1 while [ $x -le 10 ] do echo $x x=$((x + 1 )) done[/CODE] | |
Re: A couple of questions Why is stderr redirected to /dev/null in line 80? What error do you get in line 83? | |
The End.