Serial standard communication (stty)
Hello friends, I am trying to communicate with a programmer memory from Unix (HP-UX) via serial port. Well, I have some code ready stty parameters to achieve communicating the device with the computer,...
View ArticleGetting error at conditional statement.
Hi experts, I am doing an exercise which has the following requirements. Charlie will bite your finger exactly 50% of the time. First, write a function isBitten() that returns TRUE with 50%...
View ArticleChanging information supplied when running file
In unix systems I can call `file` to return me the file type. Code: file cel.vik $ cel.vik: ASCII text How can I append additional information when I create a file such that when I call `file` it...
View ArticleScript to check process status
Hi Team, I am using redhat 6.4 version server.We have a script which is used to check the process and sends email if the process is not running.If it is running it will continue and do some other...
View ArticleUNIX script to display the filename
Hi All How to answer the below interview question.. PHP Code: With a path and filename of "/mydir1/mydir2/mydir3/myfilenane.dat" write a UNIX script to display the filename
View ArticleScript creating a Volume name with the Format command
Going through creating a bunch of FC Luns and then exporting them to LDOMS. For clarity I would like to script setting a volume name on the LUN. We use a Netapp storage solution that has a command...
View ArticleTo check Blank Lines, Blank Records and Junk Characters in a File
Hi All Need Help I have a file with the below format (ABC.TXT) : Code: ®¿¿ABCDHEJJSJJ|XCBJSKK01|M|7348974982790 HDFLJDKJSKJ|KJALKSD02|M|7378439274898 KJHSAJKHHJJ|LJDSAJKK03|F|9898982039999 (cont......)...
View ArticleUNIX script can accept 1 to n parameters
Just for my leaning purpose, I appreciate if someone answer my question: A UNIX script can accept 1 to n parameters. For each of these parameters, write out the parameter id number and its value.
View ArticleWithin an awk script
Just for my learning purpose, I appreciate of someone answer my question Within an AWK script, test if Field # 4 is empty. If it is write out "Field 4 is empty", otherwise write the context of field 4.
View ArticleUNIX shells script to echo out the date value
I appreciate if someone answer this question for my learning purpose: Given a filename structure of a COUNTRY CODE, file type, date (YYYYMMDD) and two digit attempt number with an extension of ".dat",...
View ArticleAppending multiple files
I am trying to append multiple files in a directory Code: cat /a/file1.txt /a/file2.txt /a/file3.txt /a/file4.txt > /a/file.txt Except file2 every other file is appending. I interchanged file names...
View ArticleRegarding a query on making changes to a running script
Hello All, Greetings !! I have a query here to all is as follows: Question: Let's say we are running a script in a UNIX box and we have opened an another session and then made changes in script of some...
View ArticleConfigure network connectivity as guest O.S under vmware
Hi! I am not sure if this is the right place to post this question. What I did was to download vmware onto my laptop, them install a linux distro as a guest O.S., on VM network configuration I have...
View ArticleHelp on for loop with a parameter
Hi, need help to pass an paremeter to for loop script Code: $cat tp.ksh for i in `grep $1 | cut -d "/" -f 5 | cut -d" " -f2` do fgrep $i $1 | grep 'with value' | cut -d "|" -f 2 done $tp.ksh...
View ArticleDoes Shell Scripting in a Resume carry value?
Hi All, I have learnt a lot by getting help from these forums. By the knowledge acquired, i have done the following automations which have helped prevent financial loss to my client. (i) Detecting when...
View ArticleScript to find min for each unique value
I need a script that will search through multiple files and when the first 2 columns match, print out Columns 1 and 2 and the minimum value. File 1 Code: 24.01 -81.01 1.0 24.02 -81.02 1.0 24.03...
View ArticleGet line before and after string - awk
so below is the command i'm using to get X number of lines BEFORE and AFTER a specific string is found: Code: gawk '{a[NR]=$0} NR>1157 && NR<=2414 && /CALL.*EDI.*PROD.*SUPPORT/...
View ArticleSolaris - BUS error with optimize mode
Hi, I'm facing BUS (invalid address alignment) issue. Application works correctly with binaries compiled without optimization. When "-O3" (or -O2, O1) is in use, application abort with - BUS (invalid...
View ArticlePrevent kickstart to install image on external LUN
on the HP box , when we try to kickstart , the Linux gets installed on external LUN (Storage) .. so we end up unmapping the LUN and rekick , is there a way to disable the kickstart to ignore the...
View ArticleMake process parallel
Hi, I have a file which has a list of 200 tables e.g: table.txt I need to do a count for each table and store it in a file. So I did something like this: Code: for TABLE in `cat table.txt` do...
View Article