Quantcast
Channel: UNIX and Linux Forums
Browsing all 16232 articles
Browse latest View live

How to sum up data in fixed width file with decimal point?

HI Everyone, I have below source file [CODE] AAA|NAME1|ADDRESS1|300.20 BBB|NAME2|ADDRESS2|400.31 CCC|NAME3|ADDRESS3|300.34 [CODE] I have requirement where I need to sum up fourth field in above fixed...

View Article


Deleting multiple files off an ftp server once they have been downloaded

Hello, I have a server that I have to ftp files off and they all start SGRD and are followed by 6 numbers. Code: SGRD000001 SGRD000002 SGRD000003 The script I have will run every 10 mins to pick up...

View Article


awk in shellscript

Dear Members, I have the following situation I do not understand: I have a large json encoded file which I need to grep and afterwards want to extract specific information. I use this command to to...

View Article

PERL script loop problem

I have written the below PERL script to reprocess messages from a failure queue. It basically browses all the messages in the failure queue to individual files in a directory and then scans those files...

View Article

Meaning of ${1+"$@"}

I am new to unix and i saw a sh file with below command. Code: exec gpg --homedir /web/gnupg --passphrase-fd 4 ${1+"$@"} 4< /web/gnupg.passphrase Can you please expalin the mening of 4 ${1+"$@"}...

View Article


Execute Oracle gather stats via shell script

Hi , I am trying to automate a gather stats in shell script Code: #!/usr/bin/ksh export ORACLE_HOME=/orcl/app/oracle/product/11.2.0.1/db_1 export PATH="$PATH:$ORACLE_HOME/bin" export...

View Article

Sending formatted email with sendmail question

Hi All, Can anyone help with an email formatting question: Im using the following example to try and send a formatted email: Code: outputFile="file.txt"  (  echo "From: oracle@inovis.com" echo "To:...

View Article

Convert a bash to ash

hello everybody, i'm a beginner in ash and i want to convert this bash script to ash. this script send a xml file to a nagios server : Code: #!/bin/bash PROGNAME=$(basename $0) RELEASE="Revision 0.3"...

View Article


Fixed with file- removing leading zeros and adding the space

Hi All, i have a fixed width file , where each line is 3200 length. File: Code: 1ABC 1111 2222 3333 000012341 1001 2ABC 1111 2222 3333 000012342 1002 3ABC 1111 2222 3333 000112343 1003 1DEF 5555 4444...

View Article


Include pathname in awk output?

I am running an awk to verify all the memory settings for tomcat, and need to include path or directory in output .... I am running: Code: awk '{ print $3 }' /opt/dir1/dir2/*/tomcat/bin/setenv.sh...

View Article

Run multiple procedures from shell script parallely

Hi, I need to write a Shell Script wherein i will connect to a DB2 Database and run multiple DB procedures. I know how to do in a way where procedures will be called one after the other, like when...

View Article

Ntp client sync with local over ntp server

Hi, I have two ntp servers in my cluster and I want all the nodes in my cluster to sync with either of the ntp servers or just one. Unfortunately it keep rotating the sync, between my ntp server 1, ntp...

View Article

Help with text processing

I have an Input file which has a series of lines(which could vary) followed by two blank lines and then another series of lines(Could be any number of lines) followed by two blank lines and then...

View Article


Mailx sending but not receiving

Hi, I need help with mailx. When I run the below mailx command, it works fine because the exit code is fine, and the message is sent to /usr/mail/<id> Code: echo "This is a test message" | mailx...

View Article

CLI script for emailing alert if files missing in dir

Hello, i am trying to write a script that would send out an automated email in case the data loaded in a particular directory misses out on files based on the filename as it in in int, eg filename is...

View Article


Help - Infinite Loop: Error in trap function

Hi, I was working on implementing error handling in my bash scripts, and decided to use trap to send myself an email incase of any errors. But it seems that somethings has gone wrong, and I am...

View Article

Merge Two files on the basis of 2 columns at diffrent position

Hello, I am trying to merge two files with multiple records having a common columns but on first file its on 7th column and on 2nd file it on 6th column. First file(file1.txt) - 7th Column is unique...

View Article


Merging Columns

Hi, Can you please help me. I have 2 files to merge File1 Code: 1251 743 1250 742 1249 741 1248 749 1247 722 1246 740 1245 739 1244 740 1243 705 1242 631 1241 590 File2 Code: 1250 247 1249 241 1248 244...

View Article

Find && Gawk

I have several of the same file names(facts) in different directories that are "|" pipe delimited and are like such: PHP Code: xxx.xxx.xxx.xx1|blah|a|host|FQDN|domain||extra stuff blah1 blah2...

View Article

Can ksh read records with blank fields

I have a tab delimited file with some fields potentially containing no data. In ksh 'read' though treats multiple tabs as a single delimiter. Is there any way to change that behavior so I could have...

View Article
Browsing all 16232 articles
Browse latest View live