1,978 Topics

Member Avatar for
Member Avatar for sonya2525

Hi, I have a script which uploads files successfully to another server via ftp. But after the files are uploaded, I want them to be deleted (removed), but it doesn't seem to work. I would appreciate if someone could help me out with this. How can I modify my script …

Member Avatar for eggi
0
166
Member Avatar for everlast

i'm an absolute beginner in shell scripting so i need adivice: what is the best editor, and where is the best place to find tutorials for them? i'm a somewhat experienced in c++ so i understand the shell code quite quickly but i'm having truble writing it in vi because …

Member Avatar for masijade
0
94
Member Avatar for naveensurisetty

Hi can anybody help me in understanding this sed -e "1,/^%!ab-cdef$$/d;s/\.#@%&\*)/\)/g" > file.txt Naveen

Member Avatar for masijade
0
24
Member Avatar for lucky11_dude9

hi, can i just know how to use fastmail in a shell script to send mail to a group.. i know wat all arguments to use.. its like.. fastmail args file address.. but m not able to send mail.. please help me out..

0
58
Member Avatar for keef12345

Hi my family computer needs a backup script... it needs to do the following tasks for us.. The script will ask the user which directory they wish to backup? the backup will 'ask' the user for the full pathname of the backup to create also i need the script to …

Member Avatar for Duoas
0
91
Member Avatar for sopel39

why doesn't /usr/bin/time command return maximum resident set size (instead it returns always 0) and how to measure it then? Thx

Member Avatar for sopel39
0
80
Member Avatar for achilleus

consider two methods in a script as below, do_a() { spool $file1 select column1 from table1; } do_b() { spool $file2 select column1 from table2 where column2='xxxxx' } The first method returns just one value say 10001,I have to use this result in the second method in place xxxxx. I …

Member Avatar for eggi
0
89
Member Avatar for rusman

Hello, I have a script I've used on pre-Solaris 10 that works just great. Now on a Sol10 box, it is bailing on this line with this error: syntax error at line 27: `|' unexpected Here's the 'offending' line: [code]creation=`echo $backupid | sed 's/^.*_//'`[/code] I'm a bit confused as to …

Member Avatar for masijade
0
113
Member Avatar for sanjuv

Given a grid of integers size n x m, (use n=100 and m=4 to test it), write a C program that can create 4 (m) children where each will compute the sum of row m (size n). Then, the waiting parent, once all children has computed their respective sums, it …

0
50
Member Avatar for sopel39

Hi My problem is that i need to measure given command statistics (time, mem, etc) with shell script My script must basically do two things: 1. Measure overall command statistics (it is total time, maximum memory use during runtime, etc) 2. Measure command statistics in given periods of time during …

0
51
Member Avatar for Brisk172

Hi, I am new to shell scripting. I tried searching the internet for information on how to do a shell script but I'm not having any success. Basically all I want is a *.bat file that will perform the same dos command 100 times. For example, the script will open …

Member Avatar for HLA91
0
71
Member Avatar for jch

Please pardon the simplicity of this question, I kind of got thrown into these responsibilities at the last minute without training. I I need to move a file called status10.dat to a different directory using korn scripting. [code = korn] cp status10.dat* /cerner/d_p19/ccluserdir [/code] I only want to do this …

Member Avatar for ghostdog74
0
98
Member Avatar for thebladerunner

Hi, Is it possible to call the constructur of a java class from a shell script? I know you can call static methods, but can you also call the constructor? Wim.

Member Avatar for masijade
0
47
Member Avatar for chunchuwar

Dear all, I have written a small script which will send me mail on status of server. I have tested it working fine. I am facing only with message subject The last part of my script is as below, cat dailystatus.txt| mail -s "Daily Server Status Report-$yr-$mm-$dd" [email]root@ecms.co.in[/email] The script …

Member Avatar for chunchuwar
0
105
Member Avatar for dave_nithis

Hi all, a=2007-05-10 b=2007-06-10 These are the two given dates and I need to compare. The script should first compare years.If both are same or if a is lesser than b,it should print correct.If a is greater than b,then it should print error.Similarly for the dates(05 and 06). No need …

Member Avatar for ghostdog74
0
1K
Member Avatar for DemonSpeeding

This is my first time writing a bash script in Linux, basically I want to create a user but not use adduser or useradd. So, in the /etc/passwd folder I need to put data in, in this way. login:encrypted passwd:UID:GID:gecos:home directory:login shell I'm going to leave the gecos blank. Then …

0
122
Member Avatar for nroper

Hi, I want to create a script that can be run daily(as cron job?) and which does the following: 1) Queries a MySQL database to return details of registered users. 2) For each user, compares their expiry date with today's date and if the remaining period is either 30,14,7,3,2 or …

Member Avatar for ithelp
0
70
Member Avatar for rickshaw

I'm unsure if this is exclusively a unix/linux scripting forum but I need help writing a windows script (I'm more of a perl/unix scripter). I need to be able to periodically clean out the user profiles on a presentation PC in a conference room. Therefore I need a script which …

Member Avatar for Duoas
0
101
Member Avatar for #ToNeT#

Hi everybody: I have a problem :?:, I would like to paste different files which has this pattern name: namefile_number.dat like this: namefile_1.dat namefile_2.dat .... And I have tried to use paste command, for create a name_final.dat. But such I have done: [CODE] paste namefile_*.dat > name_final.dat [/CODE] It works …

Member Avatar for n2201
0
77
Member Avatar for tamilmercy

I tried to Sends email but somehow email not getting out, please help me how I can write shell script in right manner. Thanks and regards This is the one I tried my end. Script: #!/bin/sh set wma = `grep -i "java" sampletest` echo $wma mail -v -s "ALERT" [email]tamilmercy@yahoo.com[/email] …

Member Avatar for tamilmercy
0
120
Member Avatar for tonyaim83

My C++ program creates a nxn matrix with given value. For e.g if the input is 10 it will creates a matrix of 10x10 now what i want is the script should run program and give input values in a variation of 1000. Say first matrix of 1000 then 2000 …

Member Avatar for maddog39
0
74
Member Avatar for mully

hope someone can help... I am trying to run a script via cron. the script runs fine interactively when logged in as oracle user. The script should run a hot back up of the database(oracle, RHEL3) of course the oracle sid and home path are set when running it manually. …

0
61
Member Avatar for acwbrat

I am new to Daniweb and I need some help with my programming code in Unix. I have written an if-else statement for Bash Scripting and it doesn't work. I have been told that variables would help with my code but I still don't see my program working. I'm suppose …

Member Avatar for masijade
0
84
Member Avatar for acwbrat

How do I change my file extension from me.cpp to me.out or me.cpp to me.exe using Bash scripting. Thanks!

Member Avatar for masijade
0
115
Member Avatar for sgriffiths

Help! I need to total up values which are monetary ie VAR1=123.20 ( £123.20p) VAR2=2000 ( £2000 ) can i do this using expr, i can total them up, but lose the .20p Any help would be much appreciated

Member Avatar for masijade
0
65
Member Avatar for dewey_witt

OK Hi peeps new to daniweb. I have a script missing for one of my classes because I missed due to work :( It's a very simple4 script (I think) It need to eccept the input of ten numbers compair them and output the highest number. This simpler the better …

Member Avatar for radoulov
0
101
Member Avatar for udayaiisc

Dear all, Please let me know the meaning of the script. #zcat compressed_tarball.Z | (cd /export/opt; tar xvfp -) Actually I am I search of command to untar file in to mew directory. Then I got this, but I don't understand it.

Member Avatar for eggi
0
136
Member Avatar for chunchuwar

Dear all, I am facing trouble with calling exit status in a function. Here is part of my experimental shell script to do remote file transfer without prompting for password. I have created error purposefully function iv2 { rsync -a -e "ssh -i $RKEY" $RUSER@$RMACHINE:$BSDIR3/dev/* $MDIR1/dev/ 2>&1 | tee >>$RLOG_DIR/$LOGFILE …

Member Avatar for radoulov
0
85
Member Avatar for sgriffiths

Hello I have a string "c0024" How can i get rid of non numeric digits, so i am left with 0024 removed "c" I cannot think of a way of doing this

Member Avatar for radoulov
0
89
Member Avatar for skelly16

Hi All I have created a script which will email output if the file contains data, this works. But when the file contains 0 data, it tries to email but hangs, when i hit ctrl D, it ask for Cc: address, i then cancel this then it emails me out. …

Member Avatar for masijade
0
89
Member Avatar for arvindishukla

Hi All, A simple questions, can someone let me know the syntax of for loop e.g if i want to print my name 100 times ? Thanks in advance.

Member Avatar for masijade
-1
108
Member Avatar for unixrockx
0
64
Member Avatar for arvindishukla

Hi All, Small can some please let me know hpw to use logical OR in csh scripts, below is the code line which is not running and i don't know why it is entring in "if" statement, even though i'm inputing value "1", set ans = $< echo $ans if …

Member Avatar for arvindishukla
0
296
Member Avatar for spirilis

Hi, I'm Eric. Just checking in here. I'm a systems administrator working mainly with Linux and Solaris, along with a focus on storage--I've deployed and currently manage the SANs and some NAS units at my work. Special skills include shell scripting (ok I am no true 'expert' but I can …

Member Avatar for jbennet
0
79
Member Avatar for asciiletters

I have a text file that I want sed to add a few lines to right before an existing line. What I want to add is: currentpagedevice /InputAttributes get 0 get dup null eq { pop } { dup length 1 add dict copy dup /InputAttributes 1 dict dup /Priority …

Member Avatar for asciiletters
0
112
Member Avatar for Dnal

Hello I am about 3 days new to Expect, I have written a script in expect to automate fire wall back ups. But I want to beable to pull from a list of IPs of the firwalls to telnet to. then pull the configs to a file and then save …

0
61
Member Avatar for benjohnson

Hi , I have a work project on at the moment and am struggling to find the answer!! I have 2 files. 1 file contains a huge list of stuff in the following format 123456789 HOSTNAME 0 415 VLR_HPLMN I then have a file which has an entry in it …

Member Avatar for radoulov
0
75
Member Avatar for phenixdragon

I am completely new to Linux and I am trying to learn how to do some scripting. I was wondering if someone could give me an example of a script that would just go out to all certain groups that I have created and delete any files that are a …

0
76
Member Avatar for jherrera

hello, I try to make a script to move files that are not in use or open by another program or process. it is kind of cleanup script. I need to cleanup some log-files that are not in use by the programs. i know that they are tools to check …

Member Avatar for radoulov
0
88
Member Avatar for Sudarshan_Kanna

[B]input xml file[/B] <ARS> <tag1>one</tag1> <tag2>two</tag2> <tag3>three<AltError Code=123 Description=456789/></tag3> <tag4>four</tag4> <ARS> <ARS> <tag1>ABCD</tag1> <tag2>ABCD</tag2> <tag3>ddsdsds<AltError Code=123 Description=456789/></tag3> <tag4>EFGH<AltError Code=abc Description=defg/></tag4> <ARS> Expected Output: tag1|tag2|tag3|tag4|code|Description one|two|three|four|123|456789 ABCD|ABCD|ddsdsds|123|456789 ABCD|ABCD|ddsdsds|abc|defg The script should read this file and create a pipe delimited file. Each ARS tag record in the XML file should create one …

Member Avatar for ghostdog74
0
151
Member Avatar for shlmsnger

HI guys I need a shell script,from which i can read 1st line of every file present in the current directory. thanks in advance

Member Avatar for masijade
0
80
Member Avatar for skelly16

Hi Can anyone advise me on a good Korn Shell scripting book for me. Im fairly new to programming, so looking for a good korn shell book. Im considering buying two books as my work will pay for it. Any suggestions?

Member Avatar for skelly16
0
124
Member Avatar for nigel_h

I need to write a shell script to check a file timestamp and if it has not been modified within 30 minutes, kill a process and restart process. Can anyone help

0
36
Member Avatar for bob_the_welder

Hi all! Just thought I'd stop by and say hello, by way of introduction. I'm a syadmin looking after about 30 servers in an Amsterdam datacenter. Most of them are Linux of some flavor, with an occasional FreeBSD box here or there. Our friends in Redmond are currently not represented …

Member Avatar for happygeek
0
123
Member Avatar for rusman

Hi all, I have two files, both have a list of 6 digit values. I want to compare them and output the values that match up. The lines in each file are not supposed to contain the same value (in other words, line 1 in each file may or may …

Member Avatar for rusman
0
115
Member Avatar for bob_the_welder

Hi Folks! This [B]should[/B] be trivial, but because of this guy Murphy, it's turned out to be anything but. OK, here goes: Requirement: On a mail gateway running postfix, 1. dump any mail from MAILER-DAEMON via the "postsuper" command. 2. Record how many messages get dumped into a flat file …

0
71
Member Avatar for skelly16

Hi Script Masters Im new to scripting and having trouble to get this script to work. Basically i want my script to look for files within this directory /apps/gnp/prd/asia/geacssm/ssr/GNPP02/var/ft/backup/ I have put all the files i want to look for in the above directory in a txt file, example of …

0
90
Member Avatar for kerstenk

Hi guys, i need help with a script. [CODE]#!/bin/bash # This process id pid=$$ # Path to the file which contains the process id path="/var/tmp/" # File which contains the process id file="accumRunning" pname="accumData" # Command for checking and running cmd="php /home/kersten/workspace/AdBenchImporter/import.php" # check if file exists if [ -s …

Member Avatar for Sturm
0
276
Member Avatar for arvindishukla

Hi All, Can someone help me writting a function in csh / tsch shell, i'm getting below error, l () { ls -lrt ; } [COLOR="Red"][B]Badly placed ()'s.[/B][/COLOR] Thanks, Arvind S.

Member Avatar for arvindishukla
0
102
Member Avatar for arvindishukla

Hi All, Below is little bit of code, which i'm unable to run, #!/bin/csh echo answer = "" echo " Please enter x to exit from script and anyother character to continue" read answer if ( "$answer" = "x" ) then echo "Exiting from the $0 script, please the error …

0
72

The End.