Search Results

Search: Posts Made By: redoubtable
Forum: Programming 03-15-2010
1,722
Posted By redoubtable
Yes, that works, but the problem is that the...
Yes, that works, but the problem is that the strings change in size and in number of substrings, and the .]] also may change!

Another example:

[[something is something]] [[and then I was...
Forum: Programming 03-14-2010
1,722
Posted By redoubtable
Help with pattern matching
I have a group of strings like:


[[something and something [[like this]] and this [[but]] here is [[what]].]] [[another big string [[with other]] substrings.]]
I need a regular expression/way...
Forum: Red Hat 06-25-2009
1,789
Posted By redoubtable
If your windows system was installed over FAT,...
If your windows system was installed over FAT, then you'll be able to view/modify anything without restrictions.

To view installed disks and available partitions use

fdisk -l


To mount...
2,182
Posted By redoubtable
mount /dev/sda1 /mnt/usb -o noexec
mount /dev/sda1 /mnt/usb -o noexec
Forum: Programming 06-19-2009
11,560
Posted By redoubtable
I'm guessing the problem is either in...
I'm guessing the problem is either in WriteFileName or fwriting to a closed stream due to improper verification if fopen() fails.

The following code works under Linux

#include <stdio.h>...
5,867
Posted By redoubtable
sed -e '1d' filename >...
sed -e '1d' filename > new_filename_without_the_first_line
4,143
Posted By redoubtable
You have various ways to extract lines from a...
You have various ways to extract lines from a text.

You could use head/tail
head -n 3 filename| tail -n 1

You can use sed
sed -n '3p' filename

You can use awk
awk 'NR == 3 {print}'...
102,796
Posted By redoubtable
You can use: zip -r filename.zip...
You can use:

zip -r filename.zip directory_to_zip_recursively

and to unzip:

unzip filename.zip

You'll have no problem extracting it from windows.
26,093
Posted By redoubtable
Try doing find / -type l -ls
Try doing find / -type l -ls
26,093
Posted By redoubtable
I'm not sure about SunOS but try searching "man...
I'm not sure about SunOS but try searching "man find" for "type".

find / -type l
38,693
Posted By redoubtable
redoubtable@Tsunami ~ $ sed 's/\s/\n/g' nets ...
redoubtable@Tsunami ~ $ sed 's/\s/\n/g' nets
13MHZ_IN
U1.AC21
Y2.1;
13MHZ_OUT
R19.2
U1.AD21;
32KHZ_IN
46.1
C8.2
U1.AA22;
redoubtable@Tsunami ~ $

The commands you provided work in bash...
4,390
Posted By redoubtable
Use: if( $num =~ /^\d{10}$/ ) {
Use:
if( $num =~ /^\d{10}$/ ) {
Forum: Programming 02-27-2009
6,240
Posted By redoubtable
Script to detect race conditions in a given...
Script to detect race conditions in a given library or code? So you want something that will load the library or disassemble the library and search for possible race conditions? You also want that...
Forum: Programming 02-25-2009
6,240
Posted By redoubtable
How are you creating the race condition? You...
How are you creating the race condition?

You can easily prevent race conditions by creating a temporary file and using rename() to replace the file after checking the timestamp of the original...
2,280
Posted By redoubtable
That totally looks like homework. Child1:...
That totally looks like homework.

Child1: use getpwent()
Child2: use uname() and read /proc
Child3: fork()
Child4: printf()
2,280
Posted By redoubtable
I'm not sure I understand your problem. So, you...
I'm not sure I understand your problem. So, you want a program that spawns multiple childs so that each child can execute a certain code, right?

Here's a sample:

int
main ()
{
long int...
Forum: IP Networking 01-17-2009
5,403
Posted By redoubtable
Please post exactly what you wish to accomplish...
Please post exactly what you wish to accomplish with erasing ip_tables_name.

proc is a filesystem that allows user-space access to some kernel variables, you can't delete anything there.

If...
Forum: Programming 01-15-2009
4,942
Posted By redoubtable
Probably this is a kernel programming related...
Probably this is a kernel programming related problem. It would be easier to create a kernel module that accessed a certain program's memory and then a system call so you could access everything...
Forum: Programming 01-15-2009
3,421
Posted By redoubtable
/proc/PID/status will always give you the name of...
/proc/PID/status will always give you the name of the program (example: "cat") that started the process you're seeing. Even if cat changed his cmdline with prctl()/PR_SET_NAME the status would still...
5,513
Posted By redoubtable
perl -e 'rmdir("--")'
perl -e 'rmdir("--")'
7,986
Posted By redoubtable
I'm afraid that didn't show the actual shell...
I'm afraid that didn't show the actual shell you're using. Which OS/distro are you running?

Possible workarounds are installing bash or revising if the file where you're executing that code has...
7,986
Posted By redoubtable
Generally sh is just a symbolic link to your real...
Generally sh is just a symbolic link to your real shell. In my case /bin/sh points to bash.

Show me where your /bin/sh points to (ls -l /bin/sh)
7,986
Posted By redoubtable
The code is correct if you're using bash.
The code is correct if you're using bash.
Forum: Programming 01-06-2009
7,730
Posted By redoubtable
If you wish your code to work with other...
If you wish your code to work with other usernames/uids other than the current user's:

perl -e 'print "".(getpwuid($<))[0]." ".(getpwuid($<))[7]."\n";'

You can also use getpwnam() if you wish...
Forum: Programming 01-06-2009
11,479
Posted By redoubtable
The actual difference is that the first example...
The actual difference is that the first example copies the address of your pmem pointer to the stack and the second example doesn't. The second example only works because you're using malloc() which...
Showing results 1 to 25 of 240

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