1,892 Topics

Member Avatar for
Member Avatar for chris5126

hi guys, Im in the process of writing a unix mointoring program that will monitor differenet servers all runnning solaris . I am creating a main screen with summary warnings for high cpu usage, low disk space, meta device faults, high network collisions etc. All has gone well but now …

Member Avatar for eggi
0
159
Member Avatar for abhey_1998

Hi, I am in need of writing a shell script to read, database table and email the results to a list of users. Please let me know if I could provide further info. Please assist. Thanks, -Abhey

Member Avatar for abhey_1998
0
126
Member Avatar for Prince89

Hi Friends, I am new to this forum as well as new to shell scripting. I have a problem here and i need someone to solve this. Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the …

Member Avatar for chunchuwar
0
114
Member Avatar for John Jack

I want a shell script to delete files in a backup directory. The files in the directory are named according to dates. For example raw_backup071208:061727 (%y%m%d:%H%M%S). I want to compare the dates and make sure that the file is one week old before i delete it. Thanks John

Member Avatar for eggi
0
67
Member Avatar for larryperl

Here is part of my code- [Code] extrafiles1=$(ls mt.*.*.*.*) if [[ $(ls -l $file 2>/dev/null) = *$today* ]]; then if [[ $file -eq $extrafiles1 ]];then rm $file fi fi [/code] when i am running the script it's showing an error-- mtclean[239]: ./mt.log.8882.-5.1202989443474: bad number. when i just ran this command …

Member Avatar for DimaYasny
0
122
Member Avatar for kursist

Hi, I am new to bash scripting. I have some questions here, Can anybody help? I have a text file which has the following format. UserNam User full name road and house nr. post nr, city phone, mobil Department, job The first thing should be to open file and find …

Member Avatar for kursist
0
109
Member Avatar for htamayo

Hi, I'm trying to use a code that change the wallpaper automatically, but I obtain the next error: Line 18: Unexpected EOF while looking for matching `` ' Line 25: sintax error: Unexpected End of File I think the code line is: cnt=`wc -l "$temp_bg_list" | cut -f1 -d " …

Member Avatar for eggi
0
105
Member Avatar for MONITORING

I need to write a shell script which does the following: script shld be in such a way that I just need to pass a parameter and it shld generate the report by running a sql script and store it in a directory and email this report in every 30mins …

Member Avatar for shamgar
0
112
Member Avatar for alex05

I have to write a script called trying. The script takes a full path (like /users4/st/jdoe/prog.c) as an argument and displays the path and the file name. For /users4/st/jdoe/prog.c, the path is /users4/st/jdoe and the file name is prog.c. I know that I can use grep for it, but it's …

Member Avatar for msr_viz
0
247
Member Avatar for larryperl

Hiiii, here is my script-- [Code]: BackupLocation="$OPTARG" if [[ $LFlag -eq 1 ]]; then echo "Either option l or L should be given to $Programname" echo "$Usage" echo "$Programname is terminated" return $ERR; fi if [[ $isBackUp -eq 1 ]]; then if [[ ! -d $BackupLocation ]]; then echo "Non-existant …

Member Avatar for DimaYasny
0
180
Member Avatar for larryperl

Hiii, i have a doubt here-- [CODE] DirCleanupList="logs tmp corefiles" echo "$DirCleanupList" | perl -ne 'print join("\n", split(" ")) . "\n"; ' for dir in $DirCleanupList do BackupLocation="$BackupLocation/$dir" mkdir -p $BackupLocation >/dev/null 2>&1 if [[ ! -d $BackupLocation ]]; then echo "Unable to make backup directory: $BackupLocation" continue fi done …

Member Avatar for eggi
0
107
Member Avatar for anythingany

could you please find a solution for this script (called phone) that creates a simple telephone list (create an empty file called “phonlist” in home directory) . Each line in this file consist of two fields name and the phone number, the script should do the following: When user types …

0
57
Member Avatar for Robbieg6

Hey all, first post here and as im sure once i ask my question.. you will all know that i am very new the shell scripting. I spend all of time in php, not shell. I need to figure out a way to see if a shell varable has a …

Member Avatar for eggi
0
105
Member Avatar for CodyOebel

Ok, I have noticed that everything I like to do in windows using c++ can easily be done with .vbs scripts. Just to clarify the books I looked into buying to teach me .vbs all mostly talk about vbscripting for html??????????????? Is that what .vbs scripting is usually for .. …

0
63
Member Avatar for larryperl

Here is mywhole script. [CODE]WhenToRun="01:00" FilesToDelete="*log* *.log*" FileLocation="$INTAS_INSTALL_DIR/envs/logs" if [[ ! -d $FileLocation ]];then echo "The FileLocation specified in Non-Existant" fi Progname=$(basename $0) Usage="Usage:$Progname"'[-a <delete or backup>] [-l|-L <backup location>] [ -t <time>]' IsCronJob=0 if [[ "$1" = "cron" ]]; then . ~/.kshrc IsCronJob=1 if [[ -z "$INTAS_INSTALL_DIR" ]]; then …

Member Avatar for larryperl
0
157
Member Avatar for lookof2day

Hi I'm trying to compare two files names using the function given below. The files to be compared are named as xxx_yyy_abc_def_.rtf && xxx_yyy_abc_def_.html The extentions and the underscores are removed from the file names and then stored in two different arrays. So the file names stored in arrays are …

Member Avatar for lookof2day
0
139
Member Avatar for Pichard

Hi I have searched for a way to replace odd characters in a FOLDER NAME. All search-and-replace issues I have seen, only involves how to make search-and-replace on a FILE och with TEXT INSIDE a FILE. My problem is with the FOLDER NAME. My case is this: I have a …

Member Avatar for radoulov
0
100
Member Avatar for Shibani

I don't know if this is the proper forum for my question, but I'll give it a try. We have a few standalone Java applications sitting on a remote AIX box. These applications are listeners, so they start up and wait for events, i.e. they remain running, kind of like …

Member Avatar for Shibani
0
70
Member Avatar for rajasekaran.k

hello Guys,,,, I got Oneproblem in Running Two Threads Regusivily,,,, anybody of u,,,,,, can clear my dobght in using thread _join()..function in two threads.....

0
55
Member Avatar for CodyOebel

Im developing an application console based in c++ , and needed a quick and easy way to script an outlook email. I found the below script to use which works great, but for one problem. PROBLEM: When the script is ran, outlook prompts me to let me know an application …

0
64
Member Avatar for MONITORING

I am trying to create a folder with in a folder by passing a parameter. this is what I am trying to do parameter I am passing in a function today(date) is 20080124 and declared a variable dir=/ab/bc I want to create a directory with this this parameter value with …

Member Avatar for MONITORING
0
101
Member Avatar for chunchuwar

Dear all, Here is output of my command -bash-3.1$ psql -l |cut -d "|" -f1 | grep -i repo repository repository_reports $ I want to drop these database thru script one by one. My requirement is to take the these o/p one by one and use it with dropdb command. …

Member Avatar for masijade
0
56
Member Avatar for papers63

I am having an issue with the variable expansion. I want to read a list from a file. The list can have * or multiple file wildcard like - test* stuff*. Here is the script #!/bin/bash datadirin=/home/william/tmp2 filelist=`cat $listdir/$sname.list` export filelist export datadirin # echo filelist is "$filelist" echo filelist …

Member Avatar for eggi
0
83
Member Avatar for wiz83

hi, iam fairly new at unix.what iam trying to do is iam running a perl script through crontab.the problem is iam getting an error message on my mail. this is the crontab file: 24 16 22 1 * perl /rishi/s-branch/perl1/perl/filecomp.pl this is the content of my perl file #!usr/local/bin/perl @comp=`diff …

Member Avatar for DimaYasny
0
197
Member Avatar for larryperl

I have to write a shell script like this-- 1) Utility will be run under the directory owner. 2) This utility will clean files in ABC/logs. And following logs will be backed up or deleted. Dispatcher Logs Middle tier Logs Sage log Sage monitor log Sage db clean up result …

Member Avatar for larryperl
0
183
Member Avatar for vnairp11

[B]I need a script that will do the following tasks[/B] Write and test a script called ExpWord.cmd that would do the following: copy all the files in the Exploring Word directory to a new directory on your H drive called ExpWord Use a wild card character to delete all that …

Member Avatar for vnairp11
0
81
Member Avatar for rhnaeco

hi, i have a series of files like this one: D22 L58 two O12 L58 two Z5 L58 two Z19 L58 two and i want to make the first column into a variable ($var) that will be used in the rest of the shell script This is my awk script …

Member Avatar for ghostdog74
0
139
Member Avatar for larryperl

Hiii, I have a requiremnt like this--- 1) Utility will be run under MT owner. 2) This utility will clean files in ABC/envsw/logs. And following logs will be backed up or deleted. Dispatcher Logs Middle tier Logs Sage log Sage monitor log Sage db clean up result log Core files …

Member Avatar for larryperl
0
129
Member Avatar for syaorankun

hi, a hard-working but horribly lost cs major here. i'm working on a script that does global renaming using find, awk, and sed, which has wildcard inputs. i'm wondering if there's any way to strip the asterisk from the input and save it to some variable, say $str1 or just …

Member Avatar for masijade
0
371
Member Avatar for RohitSahni

Hi all, The scenario is like this: i have one file which contains some particular paths, now my aim is to make changes in this file so that i can change the path in that file.. eg: file1.txt: ABC -p /home/user/a/b/v23.9/library -l /home/user/a/b/ABC/v23.9 test.exe DEF -r v23.9 /c/d/f -p /home/user/a/b/v23.9/library …

Member Avatar for masijade
0
152
Member Avatar for rajarp

Hi all, My directory structure is as follows [B]home /md/DEV/SCRIPTS/DAILY[/B] and [B]home/md/DEV/MIS/LANDING[/B] so this command [B]find home/md/DEV/MIS/LANDING -name MIS_Customer_\*[/B] is giving me the desired output [B]/home/md/DEV/MIS/LANDING/MIS_Customer_20080114.txt.[/B] since i dont want to hardcode the path ie)home/md/DEV i opt for relative path like [B]find ../../MIS/LANDING -name MIS_Customer_\*.[/B](since all myall my scripts are …

Member Avatar for masijade
0
90
Member Avatar for Dwasifar

First off, the standard disclaimer: I am pretty new at shell scripting, and my work at this point is mainly hacked-together ideas and pieces from other people's. Thank you in advance for your tolerance. :) I am using Ubuntu Linux 7.10 Gutsy, which has the bash shell. I wrote a …

Member Avatar for radoulov
0
375
Member Avatar for lookof2day

Hi ! I'm trying to find the substring in a shell script as given: [code] #! /bin/bash HTML="<html><body>OK</body></html>" OK="OK" OFFSET=`expr index $HTML $OK` OK_LEN=`expr length $OK` var1=`expr "$OFFSET"` echo $var1 var2=`expr "$OK_LEN"` echo $var2 INPUT=`echo | awk '{ print substr("'"$HTML"'",var2,var1) }'` echo $INPUT [/code] But on running it does not …

Member Avatar for ghostdog74
0
134
Member Avatar for binnie

I would like to ask for the looping statements and conditional statements syntax and some samples for me to easily understand... And also, How can I edit numbers to have its decimal points like float and double in other programming language. I'm really noobie with Linux so can someone please …

Member Avatar for binnie
0
133
Member Avatar for dave_nithis

I want a sample Date validation script using if loops. The script should first compare "year".If the year is lesser than the current year,It should go for "month" checking. I have the script that splits the date into year,month and date.I want only the checking part. My if loop checking …

Member Avatar for jim mcnamara
0
113
Member Avatar for spikywits

Hi i need to have a update for a file that updates only the last modified content from another file.... say for example....if file A is having content like . . . hatxxxx catxxxx ratxxxx and file B(the file to be updated is having content as hatxxxx catxxxx then file …

Member Avatar for radoulov
0
113
Member Avatar for lankan

Hi, I have a script, when I run it The output overlaps : Example Instead of saying Canadian 1.00 Dollar it would say something Canadian Dollar00 I also need to know how to find the amount of decimal places in a variable and also how to check if a variable …

Member Avatar for eggi
0
112
Member Avatar for mark0420
Member Avatar for rajarp

advance happy new year to all, i am having a script.The purpose of the scripts is as follows.If the current month is march,june,september or december ,increment flag should be set to '1' otherwise increment flag should be set to '2'.the script is as follows month= date +"%m" if [ "$month" …

Member Avatar for rajarp
0
112
Member Avatar for kilogul

Im having some problems to write a shell script which will give a certain type of file in the current directory. I.e if i want to delete a certain type of extensions like .psd or jpeg, i m having some problem in logic to make a shell script. The script …

Member Avatar for eggi
0
112
Member Avatar for gurudev

HI All, I am Gurudev and this is my first post in this forum. I am software test engineer. Now a days I am trying to do automation for out ADSL product line testing. So I need to do some programming. I have installed Procomm Plus and would like to …

0
58
Member Avatar for Brik

OK - I'm new to all of this. I need to create multiple files from a list. For example Myfile1.php becomes myfile2.php, myfile3.php, myfile4.php When my list is 2 3 4 I also need to do a global find replace. I have found enough examples of doing that online I …

Member Avatar for Brik
0
82
Member Avatar for buzonjl

hi friend, I am have too this problem (GETOPENFILENAME), only that I use AutoIt, my ask myself if you can resolve the problem for other side. if your code work correctly this will being very util for my. well. If I can resolve the problem I write the solution in …

0
58
Member Avatar for mrityunjay22

the code is given as #!/bin/sh i=1; while [ $i -le 5 ] do echo "welcome $i times"; i= 'expr $i + 1 '; done it enters into infinite loop and does not increment the i variable plz suggest something exit 0;

Member Avatar for eggi
0
97
Member Avatar for mrityunjay22

i have installed cygwin with vim and vi editor but when i type into those editor nothing gets written and message comes that no string under cursor plz help somebody

Member Avatar for eggi
0
12K
Member Avatar for Allasso

Hello, I would like to use a simple "if then" test to check if an argument to a command begins with "http://" as follows: if [[ $2 == [url]http://*[/url] ]]; then command fi but the wildcard just seems to be ignored, ie., it will only execute the command if the …

Member Avatar for eggi
0
107
Member Avatar for LCY35

Hi all, I am new to shell script and really help. I need to connect to MySQL and do some proccessing. How can i do that? Thanks

Member Avatar for masijade
0
43
Member Avatar for Drags111

Hey guys! This is my first post, as im new here :S I have a simple problem for a big program. We have a .sh to install it, but when I run the .sh in terminal like i should, It says the class is not found. I believe it has …

Member Avatar for eggi
0
113
Member Avatar for jjamd64

I have an email log that needs some parsing. Can anyone help me to use sed or awk to parse this log and return only the domain names, listing them only once and ignoring case? Dec 19 14:59:09 host53a pop3d: LOGIN: DEBUG: ip=[::ffff:192.168.1.1], command=USER Dec 19 14:59:09 host53a pop3d: LOGIN: …

Member Avatar for radoulov
0
84
Member Avatar for madankumar

HI I would likt to create input files for testing, format is like this INPUT Format DISP NUM BYTES Desc 0 4 CODE 4 10 EMP NO 14 3 AGE 17 1 SEX which will be used for creating flat files ( data in excel file). OUTPUT file should be …

Member Avatar for masijade
0
71

The End.