1,978 Topics

Member Avatar for
Member Avatar for cyberdyne

hi frnds, I need a batch program that can reboot every time a system starts.It should work in NT systems too.

Member Avatar for chris5126
0
128
Member Avatar for girish.batra

Dear all I am still bit new in shell script area.I am writing down a shell script which I guess somewhere wrong so please kindly correct it. I would be greatful for that. What I actually want from this shell script is that it will move all the files one …

Member Avatar for girish.batra
0
116
Member Avatar for joikirk

Hi. I created 100 dummy mp3s, and I used the id3tool to change the tags on them. Each mp3 is named some number with the extension of mp3 appended to it (ex: 20.mp3). When I click on the file, the tags that I changed appear. What I'm trying to do …

Member Avatar for joikirk
0
104
Member Avatar for Imti

To implement a very primitive shell (a Toy Shell) that knows how to launch new programs in the foreground and the background. It should also recognize a few internal commands. More specifically, it should support the following features. It should recognize two internal commands: exit and cd. exit should use …

Member Avatar for eggi
0
83
Member Avatar for Ole Raptor

I am attempting to write a script that will add a user to the system. I am using fedora 5 and am attempting to use the useradd: command but i receive "command not found" I am also trying to get the current users from the system so i can check …

Member Avatar for Ole Raptor
0
113
Member Avatar for mamtha

I am using the below code to return the pid. But it works only if the pid is 4-digit. It returns nothing if the pid is 5-digit (see the examples). How do I fix this code for both the instances. Thanks in advance! Mamtha pid =ps -fu truecomp | grep …

Member Avatar for sbecker
0
96
Member Avatar for javavsdotnet

i have DSL router with an ip address a.b.c.d i want to write a Linux script, which when executed can restart the router. Please can anyone help me out? thnx in advance.

Member Avatar for DimaYasny
0
41
Member Avatar for sbecker

I doing a proof of concept script to automate getting a field from ps. Currently, the script takes 2 imputs and I'm almost there but cannot get awk to recognize $2. I want to invoke it like this: #./script init 2 (search for init and get PID). Obviously, $2 to …

Member Avatar for eggi
0
79
Member Avatar for Imti
Member Avatar for xthexonex

Hello all! I am fairly new to linux. I am using fedora7 bash. I am using an awk statement to extract several fields from a file and assign them to variables within awk. With some fields in that file and some variables made within awk i would like to use …

Member Avatar for ghostdog74
0
106
Member Avatar for ionzone

Hi, I am trying to make a shell script that will parse lines off error_log of Apache and parse IPs off of it. The lines I need to parse are security warnings made by ModSecurity. Example: [CODE][Fri Feb 22 22:18:46 2008] [error] [client 111.222.11.22] ModSecurity: Access denied with code 406 …

Member Avatar for dandan
0
208
Member Avatar for Jojo_DC

Does anyone know of a simple way of automatically sending replies to emails, which can repeat X amount of times. For example, I want to reply to an email from John Smith 20 times with "ABC" , "DEF", "EFG"....etc.. sequentially.. Thanks..

Member Avatar for eggi
0
85
Member Avatar for meak99

Looking for some help in renaming files using a shell script. Suppose I have a directory which contains several files, some of which are `*.dat` files. If there are 7 `*.dat` files, I would like to rename all 7 `*.dat` files to `*.01`, `*.02`, ... `*.07` Here is what I …

Member Avatar for eggi
0
137
Member Avatar for larryperl

[CODE]Programname=$(basename $0) # While scheduling to cron, program name is needed. Usage="Usage: $Programname [-a mtDelete/mtBackup] [-l/-L Backuplocation] [-t now/cron/hh:mm]" IsCronJob=1 # default, script will run at now. isBackUp=0 # default, it will take back up. lFlag=0 # it is optional. default value is zero LFlag=0 # it is optional. dfault …

Member Avatar for eggi
0
103
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
248
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
58
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 EchoQuiet

Greetings Everyone, I've found myself being referred to <DANIWEB> from web development-related Google searches quite frequently. So I decided to become a member. I didn't realize the depth of the community and content here until this morning when I was looking up XHTML related issues. Every other search was bringing …

Member Avatar for jbennet
0
234
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 darkglyph

hi, i recently just got infected by a script i think named kathyros. i tried deleting it but it keeps on coming back. maybe you guys could help me. this is the inside of the script: 'kathyros v1.0 'fucker Phils 'email me if you found this :) @ [email]kathyros@yahoo.com[/email] 'May …

Member Avatar for HeroOfTheDay
0
182
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
84
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
198
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
141
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
372
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
377
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

The End.