UNIX- Adding days to datetime variable
Hello All, I have a date with timestamp stored in a variable and another variable which stores no. of days. Var1=2014-12-11 12:54:21 Var2=5 In my unix script, I have to add the no. of days stored in...
View ArticleSeveral exec on find send all the output to the last redirection
Example script: Code: find mydir -type f -exec echo {}>aaa \; -exec echo {}>bbb \; The two paths go the the bbb file, while there should be one of them on each file. How should I do it to get it...
View ArticleWorking with lines or variables that have spaces or special characters
Example: Code: while read line do stat -c %G $line done < somefile.txt The problem is that inside somefile.txt lines can have any symbol allowed as file name, like (). Even with spaces, it splits...
View ArticleSSH strangeness
Two SPARC servers running latest patches on S10U11. When the mysql account logs into either machine from a windows 7 workstation via putty or other ssh program, the first attempt works fine. Trying to...
View ArticleCan't remove spaces with sed when calling it from sh -c
The following command works Code: echo "some text with spaces" | sh -c 'sed -e 's/t//g'' But this doesn't and should Code: echo "some text with spaces" | sh -c 'sed -e 's/ //g'' Any ideas?
View ArticleHow to integrate AIX Client LPAR to make use of existing MS AD LDAP ?
Hi All, Its regarding the LDAP in AIX. we already have Microsoft Active Directory (LDAP) Server. And would like to integrate My client AIX LPAR to this LDAP server. So' that we can directly use Active...
View ArticleScript to Push Files
Hey Guys, Thanks for always being helpful, I have another issue that I need a little insight on how to fix. See the below script I have and the error I get. I don't understand why it does that, am I...
View ArticleLinker errors linking to .a files on OS X
Basically my problem is that when I try to compile anything using ./configure && make, it fails because of linker errors. I can reproduce the behavior I'm getting as follows: I have the two...
View ArticleDeleting all files containing string (WINDOWS DOS)
So I want to skim through all folders (ongoing from the curr dir) and delete all files that contain the string: "in conflikt standing copy". Is this possible WITH DOS ?
View ArticleBash Script Looping all the time
Hello, I have a database file, named data.txt, and a shell script (convert.sh) to convert data.txt from columns to row. Output file name will be column_to_row.txt In this example data.txt has only four...
View ArticleReplace multiple patterns together with retaining the text in between
Hi Team I have the following text in one of the file Code: j1738-abc-system_id(in.value1)-2838 G566-deF-system_id(in.value2)-7489 I want to remove system_id(...) combination completely The output...
View ArticleCommand for vlookup function
Hello experts, I have large text files that need to be arranged using a function like excel's vlookup. I have been playing with awk command but didn't really come up with a solution. Could anyone...
View ArticleHow to conditionally display and remove first line only?
I have a maildir hierarchy of 90k eml files and; 1) I would like to walk the tree and display the first line from any file, whose first line begins with; From - That's "From space dash space" and only...
View ArticleSolaris10 and pxeLinux
I want to run solaris10 with my pxelinux server i put on pxelinux.cfg/default this Code: LABEL solaris 10 kernel mboot.c32 append -solaris solaris/boot/platform/i86pc/kernel/unix -v -m verbose...
View ArticleCurious About Offbeat "#" Usage in C . . .
Greetings! Being incredibly rusty in the little C which I ever knew, and, not knowing where else to turn but the best programming community on the web ( :) ), I submit the following snippet for a quick...
View ArticleExecuting 'exit' command from shell script
Hi, I am writing shell script to automate few use cases for CLI interface. We have CLI interface which has bunch of commands. I am trying to execute one of the commands 'exit' as part of automation to...
View ArticleHelp needed HP UX 11.11i new install on C8000 Desktop messaging system error...
Hi, I have a HP UX C8000 box , have installed 11.11i from 4 x cds numerous times to try to get a functioning Network or to try and get rid of this error on start up, after new install and 1st startup I...
View ArticleReplace from refrence file
Input file Code: FS01,/root_vdm_9/UKSR06_FS01,test1 FS04,/root_vdm_11/UKSR04_FS04,test2 FS01,/root_vdm_7/UKSR02_FS01,test4 FS01,/root_vdm_12/UKSR03_FS01/dhdhdhdh,test5...
View Article[OS X] Last modification time from shell in CCYYMMDDhhmm.ss format
This example shows last mtime from epoch Code: $ stat -f %m somefile 752911565 But would like to see it like that: Code: 199311100606.05
View ArticleTail -f | grep > output.txt
hi guys, I perform a sort of monitoring. I have a server running and with Code: tail -f | grep "Searchstring" I monitor the log-file for recent specific entries. This is ok and works fine. Now, in...
View Article