unix

Reading UNIX file properties via C# over NFS

Hi, i have two servers. solaris 10 acts as a NFS server win 2003 ernterprise server with installed UNIX/NFS extensions acts as a NFS client The win 2003 server has mounted one share of the solaris system. How can i check (via C#) the origin UNIX file properties (e.g.: -rw-r--r--) of a remote file located on the NFS share? rené ...

script,unix,compare

i have two files ... file1: 002009092312291100098420090922111 010555101070002956200453T+00001190.81+00001295.920010.87P 010555101070002956200449J+00003128.85+00003693.90+00003128 010555101070002956200176H+00000281.14+00000300.32+00000281 file2: 002009092410521000098420090709111 010560458520002547500432M+00001822.88+00001592.96+00001...

Executing the command instead of printing

The following command "prints" the correct mysql commands. But I want to "execute" them :) mysqlshow -uroot -pPassWord | awk '{print "mysqlshow -uroot -pPassWord --count", $2;} mysqlshow -uroot -pPassWord --count world mysqlshow -uroot -pPassWord --count zabbix ...

What are some best UNIX Online Tutorials/Books ?

Hi, I am new to Unix Operating System and my job involves mainly working with Unix Environment and so what are some of the best resources, online/books that one would recommend for Unix. Thanks. ...

I have a vim config. However, when I paste text...

I do "set:paste" That will allow me to paste text into putty very nicely. However, my "smart indents" and 'auto tabbing' --which is in my original config..is gone!? How do I make it so that I don't have to do "set: paste" everytime I want to paste something and if I do have to do that...I can easily go back to normal config? s...

Does anyone use (Al)pine as their email client?

Does anyone use Alpine/pine as their primary email client? If so, can you explain what you use as an address book so that I don't have to remember all of my contacts information. Also, does autocomplete exist for typing out email address? ...

Remove old error log files

error_log files in /var/log/httpd/ are consuming a lot of disk space. There are error_log.1, error_log.2 files as well. I will like to delete the old files automatically and keep only the current one. ...

connect to a DB inside awk script

Hi In a shell script we can connect to a Database using sqlplus on unix. can i perform the same thing inside an awk script? i need to access the output of a select query inside an awk script.is that possible? ...

Unix Sort with U

Anyone knows how this sort works? What do they [+0.2 -0.42 +0.0 -0.1 -o] mean? CmdString.Format("sort -u +0.2 -0.42 +0.0 -0.1 -o %s %s", (const char *)TempFilename, (const char *)TempFilename); ...

Compares lines in two files

how could we compare lines in two files using a shell script. I want to compare line in one file with the line in other.diff will give me all the differences in two files at a time.i want a line in the first file to be compared with all the lines in the second file and get the common lines as the output. with the line numbers where the ...

Fork before or after accepting connections?

The following snippet of code creates 4 processes, all sharing the same listening socket. Is there any danger in doing this? Should I always have one listening process and fork after connections are accepted, in the conventional manner? for (p = 0; p < 3; p++) { pid = fork(); if (pid == 0) break; } while (1) { unsigned int cl...

awk command -to accept two variables as parameters and return a value

I have a file which has 50 rows. Each row is made up of three columns. The first two columns are the variables and this will be passed as parameters to return the 3rd column's value. for ex.. command_file.txt is the file and it contains A B 10 C D 20 E F 30 G H 50 I J 70 ... I have a script with the following command. #!/user/bin/...

paste without temporary files in Unix

I'm trying to use the Unix command paste, which is like a column-appending form of cat, and came across a puzzle I've never known how to solve in Unix. How can you use the outputs of two different programs as the input for another program (without using temporary files)? Ideally, I'd do this (without using temporary files): ./progA > ...

shell - get exit code of background process

Hi, I have a command CMD called from my main bourne shell script that takes forever. I want to modify the script as follows: Run the command CMD in parallel as a background process ($CMD &). In the main script, have a loop to monitor the spawned command every few seconds. The loop also echoes some messages to stdout indicating progr...

problem in a shell command

Hi, i am trying the following command on the command line ps -u `id | cut -f2 -d"=" | cut -f1 -d"("` -f | grep ppLSN | awk '{print $9}' | awk '{FS="=";print $2}' | grep KLMN | wc -l the value of teh command is returned as 7. but when i am putting the same command inside a script abc_sh like below ps -u `id | cut -f2 -d"=" | cut ...

Problem in running a script

i have unix shell script which is need to be run like below test_sh XYZ=KLMN the content of the script is #!/bin/ksh echo $XYZ for using the value of XYZ i have do set -k before i run the script. is there a way where i can do this without doint set -k before running the script. or is there something that i can do in the script...

problem in shell script

I am trying this option #!/bin/ksh echo $1 awk '{FS="=";print $2}' $1 and on the command line test_sh INSTANCE=VIJAY but awk is failing. Is there any problem here? Basically I need the value VIJAY passed on the command line. ...

How to set file owner to Logged in user in SAP ABAP?

When creating a file using OPEN DATASET, SAP creates the File with the owner as < SYSID >ADM. How to set this as the logged in user? Thanks ...

convert exponential to decimal in python

I have an array in python that contains a set of values, some of them are 2.32313e+07 2.1155e+07 1.923e+07 11856 112.32 How do I convert the exponential formats to the decimal format Additional: Is there a way I can convert the exponent directly to decimal when printing out in UNIX with awk? ...

Running a Ruby script outside of my rails app?

I have a script that I want to loop indefinitely outside my rails app, essentially it's just writing values over serial (with the SerialPort library), Can I just us backticks to run my script? Lastly my biggest concern is that the script will block requests to my rails app while its running. I want it to spawn it's own process, is this...