1,891 Topics

Member Avatar for
Member Avatar for sri1230

Hello guys - Need help with a windows batch script that would kill processes by the memory usage but leave the last one. For example if i have 10 java.exe processes running i want to kill the top 9 by memory usage and leave the last one alone. Help appreciated! …

Member Avatar for Hawkeye Python
0
107
Member Avatar for shawnk

I am trying to execute a simple grep command in my shell script. I am not sure why it also greps the other file system. [COLOR="Green"]> df -g|grep /oracle/BP1/sapdata1 70.00 11.37 84% 21 1% /oracle/BP1/sapdata1 100.00 89.44 11% 8 1% /oracle/BP1/sapdata10 > df -g|grep /oracle/BP1/sapdata10 100.00 89.44 11% 8 1% …

Member Avatar for shawnk
0
97
Member Avatar for johndoe444

hi, how can i measure the accurate run time of a program by writing a shell script? Like I want to use some for loop and run some samples and then i want to subtract the end_time-start_time to get the duration and thereby average.

Member Avatar for thekashyap
0
312
Member Avatar for lomaree

Hi All, I am a newbie and I am trying to write a script to be run in solaris so that it will send email to admin about the file system statistics e.g. file system current size, amount of space left and all root emails about system health. Any help …

Member Avatar for thekashyap
0
31
Member Avatar for Democles

I have a text file that reading the directories i need to create the only problem is I need to include a if statement to check if the directory is already made. How do I go about doing this I have these two files currently.. [CODE]#1/bin/bash cat directory.txt | while …

Member Avatar for thekashyap
0
103
Member Avatar for miraj0072004

hello friends, This may sound very primitive, but that's no wonder cos I am very new to this. I would like to know how to find out the current operating system that I am using, with shell commands. For example, if I am using ubuntu and fedora , and a …

Member Avatar for thekashyap
0
54
Member Avatar for miraj0072004

hi friends, I need some help in keeping count of particular IP addresses that I read from a text file with ip addresses.i.e let's say 123.456.789.123 - 15 times, 542.432.456.123 - 6 times etc etc ...thanks in advance

Member Avatar for miraj0072004
0
84
Member Avatar for Stubaan

Hi folks I have tried posting this in the python forum without any luck ([url]http://www.daniweb.com/forums/post1120606.html#post1120606[/url]), as well as on the official Intel Fortran forum (because I have also attempted it in Fortran). I am not one inch closer to solving this. All I want is to be able to overwrite, …

Member Avatar for cfajohnson
0
120
Member Avatar for chris5126

Hi guys, I have a shell script which is to run on multiple OS, I have the following two variables declared: [code] NPAID_CMD="ps -A -o pid,comm | grep NParchiveSM | awk -F \" " '{print $1}'\" SHMMAX="echo "Not impletemted on $OS"" [/code] On Linux the above decelerations are fine and …

Member Avatar for cfajohnson
0
78
Member Avatar for inspire87

I have the following line of code: [CODE]sed -i "/MatchText/ s/${tgrepLine}/${tNewLine}/" filename.output[/CODE] filename.output contains this: [CODE]blablabla PATH=".:/home/root/bin/:/usr/local/bin/" blablabla[/CODE] Variable ${tgrepLine} contains: PATH=".:/home/root/bin/:/usr/local/bin/" Variable ${tNewLine} contains: PATH="/home/user/bin/:.:/home/root/bin/:/usr/local/bin/" As you can see, both variables contains " (double quotes) If I run the 'sed -i' command, I get an error. I cant use …

Member Avatar for cfajohnson
0
126
Member Avatar for rhoit

hi every one.... i was trying to rename the no of files [QUOTE] Like "Prison.Break.S01E01.HDTV.XviD-LOL.srt" to "Prison Break.101.srt" and so on to the following files Desktop/1/Prison.Break.S01E01.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E02.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E03.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E04.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E05.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E06.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E07.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E08.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E09.HDTV.XviD-LOL.srt[/QUOTE] i tried to use [CODE]$mv "Prison.Break.S01E0[1-9].HDTV.XviD-LOL.srt" "Prison Break.10[1-9]" mv: target `Prison Break.10[1-9]' is not a directory …

Member Avatar for nezachem
0
198
Member Avatar for shanie7

Hi i am new to shell scripting, i need some help please. I have a folder that i am sharing between my linux server and my windows computer. I want to do a shell script that let me know when the size of that folder has passed 110 gb, and …

Member Avatar for thekashyap
0
173
Member Avatar for sarosh

hi everyone... we have to run any python file e.g. show.py at startup..i.e. when OS starts it runs automatically. we are proceeding this way, writing a startup script named forfyp2 ,pasting it in init.d , making it exe using chmod , creating startup links using update-rc.d forfyp2 defaults. After this …

0
75
Member Avatar for rhoit

Little bit help here i wanna cp the no of files listed in text file... i tried to use [CODE]for songs in $(cat "~Desktop/1/list.txt"); do cp $songs NewSongs/; done[/CODE] but my text file has the path with spaces like /home/rhohit/Music/00 Database/Albatroos/Albatroos/Albatroos - 01.आवाज.mp3 /home/rhohit/Music/00 Database/Albatroos/Albatroos/Albatroos - 02.खसेका तारा.mp3 /home/rhohit/Music/00 Database/Albatroos/Albatroos/Albatroos …

Member Avatar for Aia
0
98
Member Avatar for Stubaan

Hi folks I am struggling to pass the value of a variable, to be used as an argument for a number of sequentially called python scripts, themselves called from a bash script. Apologies for the pathname chaos. Phase 1: reads the case names from a text file, line by line, …

Member Avatar for Stubaan
0
4K
Member Avatar for bharatk

Hello I have a .py file. I am creating a .bat file which when clicked runs the python script & saves the output as a text file in the same directory. I gave this inside the batch file [CODE]%CD%\App1.py > %CD%\op.txt [/CODE] but I am not able to see the …

Member Avatar for bharatk
0
245
Member Avatar for Obi-Won-Knewbie

[LIST] I am new at scripting and need help developing a script that will look at a diff file size I've created from the original file and compare the size to the orignal and send a return code of 1 to the /etc/notify if the file is less than 6-% …

Member Avatar for thekashyap
0
134
Member Avatar for garyinspringhil

I have a series of variables like so: $BLACKPASS=7 $BLACKCUTDEPTH=567 $SURFACE=325 NUMBEROFPASSES=$((($BLACKCUTDEPTH-$SURFACE )/$BLACKPASS)) #is 34 Text To Edit: IN; PU; SP6; !PZ-325,200; snip here (inclusive)SP6 is a known/usable starting point VS25; PU9170,-10213; PD9170,-10827; PD7967,-10827; PD7967,-10213; PD9170,-10213; PD9170,-10213; PU9170,-10213; snip stops here inclusive BEFORE the next SPx line SP7; !PZ-325,200; VS8; …

0
80
Member Avatar for wish4129

Hi guys, i would like to ask that is there any way to check whether an process is ended by using batch scripting? i want to start another program B only when the program A is ended.. Any reply would be appreciated, thank you and have a nice day.

Member Avatar for Salem
0
93
Member Avatar for freshfitz

Is there any way to launch this .vbs and popup which file to run? Dim WSHShell Set WSHShell = WScript.CreateObject("WScript.Shell") ' open maximized and wait WSHShell.Run "c:\progra~1\la\file1.exe" or run c:\progra~1\la\file2.exe Set WSHShell = Nothing WScript.Quit(0)

0
70
Member Avatar for jananis

Hi all can anyone please help me write a shell script for file transfer from windows to unix server and vice versa. i m new to unix shell scripting so kindly bare with the small mistakes tht i mite have made the code is: [CODE]#!/bin/sh filename="sample.txt" user='user' password='passwd' IP='some ip' …

Member Avatar for jananis
0
348
Member Avatar for johndoe444

For the code snippet I got some error which I can't explicate: [CODE]xyz@lin309-05:~/workspace/os-prj2$ ps -ef | grep node.o xyz 21679 1 0 20:00 pts/1 00:00:00 ssh lin309-05.cise.ufl.edu cd workspace/os-prj2 ; touch /tmp/fu0 ; ./node.o host0 4001 3 2 6 3 lin309-02.cise.ufl.edu:4002 lin309-03.cise.ufl.edu:4003 storm.cise.ufl.edu:4006 host1 host2 host5 host0 xyz 21700 21699 …

Member Avatar for nezachem
0
98
Member Avatar for Shaikh Mohsin

Hello every one i have small shell script code i want to load it as system boots up,how to do it and where to put that code in new kernel that can take effect as soon as i start my pc..... i have tryed some steps 1] create .sh file …

0
75
Member Avatar for yupi

Hi, i am new at shell scripting and i need your help. i have a very big txt file that contains articles,authors,etc. Each article has this form: .I <article's serial number> <article information(in new line)>. What I need is a script tha will split this file into smaller ones.The script …

Member Avatar for Kruptein
0
136
Member Avatar for Adila

I'm editing the startxwin.bat which came with cygwin What I'm trying to do is, to be able to run a ns simulation automatically when I open the batch file without having to type this command: [CODE]ns example.tcl[/CODE] I'm not sure if I'm on the right track, I've been playing around …

0
63
Member Avatar for flipjoebanana

Basically searching all files in a directory and locating those that contain a certain word within them. For example, I want to know what files contain the word 'apple', if there is just print the filenames that contain 'apple' somewhere in the text. The only thing I really need to …

Member Avatar for thekashyap
0
128
Member Avatar for mona-lolly
Member Avatar for thekashyap
0
128
Member Avatar for arvindikchari

Hello I have 2 very similar sites, aariclinkdirectory.tk and Abbottlinkdirectory.tk . The 2 sites use the same script, both are link directories, only their names are different. What I did was I installed Aariclinkdirectory.tk successfully, and then copied the db data for this site, and suitably modified the db data …

0
87
Member Avatar for tones1986

Hey guys - i am working off three files that contain information on associates and their sales. The files are: products: (product ID, name, price item) % cat products 103:sway bar:49.99 101ropeller:104.99 104:fishing line:0.99 ... 108:wheel:49.99 111:lock:31.00 102:trailer hitch:97.95 sales: (product ID,num. sold, date sale, associate ID) % cat sales …

Member Avatar for bobydavid71
0
210
Member Avatar for komyg

Hi I've developed a C# program that takes a directory list as its arguments. What I want to do is execute a batch script that would run a command like dir /b and send its ouput to my C# program. I believe that if I were using Linux, my script …

Member Avatar for Salem
0
148
Member Avatar for sarasara

Hey all I have a php script that I need to be running 24/7 on a linux platform. I have a dedicated server with centos 5 that I have access via ssh. The php script is written so that it loops indefinitely. However, it inexplicably hangs after 30 - 60 …

Member Avatar for sknake
0
141
Member Avatar for reham84

hi all i want to take a paragraph from a file and append this paragraph after ^L in another fille using shell scripting .............could you help me

Member Avatar for issue9
0
109
Member Avatar for aswin_agarwal

Hello, I have a file say id.dat In this file each line contains only an id number. I have a group of files (say 1.dat, 2.dat, 3.dat,...., 50.dat). There are unspecified number of records in each of them. If any of these records contain any of the id number present …

Member Avatar for thekashyap
0
89
Member Avatar for naziatarannum

Hi All, I'm a newbie. I need to know if we can write a script that tracks the number of times an xls file was downloaded in a day. I tried searching many books & websites, but of no use. Kindly show me the way.. Please.. Thanks

Member Avatar for serpiko
0
332
Member Avatar for gubbu

I have a directlry with log files example (logs/server.log.2009-10-17 or logs/server.log.2009-10-18) 2009-10-17 01:33:00,710 Beginning a.gzip 2009-10-17 01:33:56,704 Completed a.gzip 2009-10-17 01:33:56,704 Beginning b.gzip 2009-10-17 01:34:45,828 Completed b.gzip Now I have a directory which has all these files as well and if you do "zcat a.zip|wc -l you will find the …

Member Avatar for JeoSaurus
0
102
Member Avatar for crazysoul13

Hi I need anybody to help me this command in UNIX SHell Scripting. It goes to a website and take a snap shot and stores it in directory. Thanks

Member Avatar for JeoSaurus
0
102
Member Avatar for palavi

HI All, I am not able to run a jar file in UNIX. I have a shell script which is throwing this error. [CODE]Exception in thread "main" java.lang.NoClassDefFoundError: dao/Demoface[/CODE] classpath no issues as i am executing all files in the same directory named scripts folder whch has all jars files …

Member Avatar for palavi
0
166
Member Avatar for tech291083

Hi, Need some good books for a Linux beginner on the following topics, could anyone please suggest me some good titles based on your experience, Sed & Awk Bash/Shell scripting Thanks a lot,

Member Avatar for tech291083
0
88
Member Avatar for dimitar.dk
Member Avatar for JeoSaurus
0
140
Member Avatar for modesto916

Hi guys, I am Brazillian and i don't know how to speak english very well, but, let's to the question: I need a solution to automatically write a sequence of number to a file, for example, to write automatically to a file the number 1 at 254, this is what …

Member Avatar for JeoSaurus
0
118
Member Avatar for kenshin88

Hello everyone,I need some help over here with grep i have this [CODE]grep -n hello filename grep -v hello filename grep -y hello filename grep -i hello filename grep -w hello filename grep -f file hello filename [/CODE] and i have to execute these commands with a different way. For …

Member Avatar for JeoSaurus
0
139
Member Avatar for johndoe444

Hi, The situation I am in is as follows: There are some computers in a network. They are sharing the same file server ie the same home directory. I am not sure how it works but logging from any machine using the same user name takes me to the same …

Member Avatar for JeoSaurus
0
99
Member Avatar for johndb

If I type [CODE]start microsoft word.exe[/CODE] or [CODE]start internet explorer.exe[/CODE] those programs won't start. If I type [CODE]start notepad.exe[/CODE] that program will start because I have the right name. Where would I find on my pc or on the web the correct terms / names to use when referring to …

Member Avatar for sknake
0
242
Member Avatar for ilove2smoke

Dear other forum members, I'm writing a script for my homework, but I'm scratching all over my head and still can't figure out what I did wrong. I appreciate if anyone of you can point out my errors. I thank you in advance. [CODE] -bash-3.2$ cat payinfo #!/bin/bash # #This …

0
58
Member Avatar for milanese

Hi, I am very new when it comes to batch files and I need to copy some files from a directory to another on a windows 2003 server. I have writeen a simple batch file which looks like this: [code]@echo off SET Day=%date:~0,2% SET Month=%date:~3,2% SET Year=%date:~6,4% SET cdate=%Year%%Month%%Day% SET …

Member Avatar for Aia
0
111
Member Avatar for MrHooper

Hello, I am new to shell scripting and am having some trouble writing a script that will work the way I want it to. I am good at the one liners, but when I try to string them together I get errors. I have a ftp server that will trigger …

Member Avatar for MrHooper
0
153
Member Avatar for chrisp200

What I am trying to do is use to retrieve information from a .txt file and use it in a drop down menu. I am using Cgi and not sure exactly how you do it. This is the shell script that will abstract the information I need for the drop …

0
84
Member Avatar for NewbieProgram

My professor wants us to write a script that will do the following: -Catch him online and output the time/day -Where did he login, ie College or Home (ip address provided is ok too) -What was he doing The crontab should run every 30 mins and automatically email him all …

Member Avatar for sknake
0
125
Member Avatar for Mattpd

I need to grep a line from a text file, and delete the fourth and fifth field. then save it back to the text file. If that wont work I could also grep the line, and delete the first number and everything after it on that line. Both would accomplish …

Member Avatar for hichnam
0
155
Member Avatar for Beencountry

Hey guys, Im in a basic programming class. Mainly using VBS scripting nothing else on Windows XP. All of the sudden my prof gave us this assignment for shell scripting. I don't know hardly anything about this. Objective: Create a single shell script in Windows/Linux that will do (all) the …

Member Avatar for cfajohnson
0
81

The End.