1,978 Topics

Member Avatar for
Member Avatar for harris2107

Hi all, I have a file (tnsnames.ora in Oracle) from which i have to extract the values of two fields. Suppose following is the content of my file called "inputfile.txt" (ADDRESS = ( PROTOCOL = TCP ) ( HOST = 1.1 ) ( PORT = 1521 )) (ADDRESS=(PROTOCOL=TCP)(HOST=2.1)(PORT=1521)) (ADDRESS = …

Member Avatar for Fest3er
0
317
Member Avatar for earlysame55

Dear all, I'm doing a script to create a DB user on all machines. I have no way of using sudo. This is for a cross section of sun machines. i need to ssh to the server, then do a su to root, create the account and then exit. i …

Member Avatar for Fest3er
0
96
Member Avatar for shyamalaa

I hve code like echo $1 echo $2 and am executing the code as ./script.sh /home/*.txt /home/*.xsd [B]The corresponding .txt files and .xsd files of the directory are getting substitued as the command line argument .[/B] and it prints smething like data.txt value.xsd [B] Apart frm using * [/B]if i …

Member Avatar for masijade
0
85
Member Avatar for shyamalaa

file_list='find /home/attrib/ -name *.csv' for fn in $file_list do echo "Inside the loop" echo $fn done I need the list files available in the specified directory find /home/attrib/ -name *.csv - This works on the command line and gives the desired output . But the above script Gives me output …

Member Avatar for shyamalaa
0
126
Member Avatar for Sturm

Ok so I made the following script: [code=bash] #!/bin/sh if ! ps -C screen > /dev/null then exec xterm -fg green -bg black -e screen else if ps -C xterm > /dev/null then exec xterm -fg green -bg black -e screen else exec xterm -fg green -bg black -e screen …

0
74
Member Avatar for StingRay411

I have found a script which does password changes on multiple machines without installing additional packages which is what I need. Problem is it uses telnet and ftp. I need to modify this to use ssh and scp. Any help greatly appreciated. Thanks #! /usr/bin/ksh # changepass --- change the …

0
77
Member Avatar for damanjit

for i in table1 table2 table3 table4 do perl -ne 's/ *\|/\|/g; print' ${AHS_DATA}/${i} > ./${i}.dat done what does `perl -ne 's/ *\|/\|/g; print' ${AHS_DATA}/${i} > ./${i}.dat` mean?

Member Avatar for masijade
0
108
Member Avatar for nathanpacker

Hey, I need to know the command for adding secondary groups for a user. The only catch is that I have to assume that they are already members of some secondary groups. And if I use modprpw -G [group], then it erases any secondary groups they were previously in, and …

Member Avatar for nathanpacker
0
95
Member Avatar for Aarsyth

So I am hoping this is a very simple fix. I am still learning how to write some scripts but I have a file with a list of names such as: sname.txt Joey Kaylin Dad Mom Melissa Toby I am trying to have the script check the value of it's …

Member Avatar for masijade
0
130
Member Avatar for ajaykajla

Hi All, This is my 1st post in this forum, and new to shell scripting too, so to start with I would like to share something I have created today My Question: I would like to get the output of this script in a html page. =========================================== #!/bin/bash echo -n …

0
49
Member Avatar for nathanpacker

Hey, I'm running an HP-UX box, trying to create a little script that will compare the /etc/passwd file with another file I have created. Each line in this file, let's call it /etc/myusers, has a pin that the user has chosen (not necessarily unique), then their userid, then the comments …

Member Avatar for nathanpacker
0
101
Member Avatar for kaushikjana07

Hello. I've given a task to 'print all the files in a directory in the format---<File name> <Size in Byte> <No of Disk blocks used> ,sorted by 'disk blocks used'(reverse order)..............if same no of disk blocks are used by two files then largest file will be printed first' I used …

0
54
Member Avatar for applegrew

My college has Cyberoam software installed at the server. So, we need to visit its page and login there before we can use the internet. The problem is that we need to keep the page of Cyberoam (into which we logged in) open. If we close that then our net …

Member Avatar for cereal
0
99
Member Avatar for faizalms

Guys, I'm quite new with awk and wanna do something like this: let say i have a file with this content : aaaa,bbbb,cccc,dddd and i wanna do an insert of " " only on the third column. and the output to be like this : aaaa,bbbb,"cccc",dddd fyi, the file contains …

Member Avatar for faizalms
0
127
Member Avatar for vrgurav

Hi all, can any one help me to solve the below query #!/bin/ksh #create or replace procedure a1 (a in number, b out varchar2) #is #begin --for testing purpose # b :='OKAY'; #end; $ORACLE_HOME/bin/sqlplus -s $userid << EOF set timing on set arraysize 5000 set serveroutput on size 1000000 exec …

0
99
Member Avatar for kalaivani.mani
Member Avatar for Infarction
0
76
Member Avatar for dyoung02

Hi All, I am trying to use awk to strip out the java version after I run the java -version command. Unfortunately nothing I try works. Here is the command I am running along with the output: # /h/jre/bin/java -version java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build …

Member Avatar for dyoung02
0
134
Member Avatar for ezb

I'm new to bash, only been doing it a day or so, but having some trouble with one thing. I am trying to create a script that checks for updates, places them into a file, slightly formats them, then emails them. It's the latter I'm having trouble with, I have …

Member Avatar for ezb
0
105
Member Avatar for nathanpacker

I originally posted this in the wrong forum, so I hope I don't get ripped apart for a double post. As part of my new job, I'm learning a little shell scripting, working on an HP-UX system. I'm trying to automate a user account creation process, and I need to …

Member Avatar for nathanpacker
0
129
Member Avatar for Vikas Katara

I am making a script in Which FTP has to run automatically rather than providing user and password manualy...i just want to know the status that the file i am sending after FTP starts is reached successfully of not to destination by making a logfile ...which shows it is successful …

Member Avatar for masijade
0
103
Member Avatar for GOGO@FreeBSD

i have whrite this to learn a bit shell scripting, but now theres a mistake in it and i cant figure it out... (sry my english is very bad xD) here is my script: #!/bin/sh echo "This Programm will help u create, delete and coppy Directories and Files." echo "What …

Member Avatar for ravinpals
0
97
Member Avatar for nathanpacker

Hey, I didn't see a forum for shell scripting, so I hope this is the place to put it. As part of my new job, I'm learning a little shell scripting, working on an HP-UX system. I'm trying to automate a user account creation process, and I need to access …

Member Avatar for jbennet
0
93
Member Avatar for vrgurav

Hi , when i specify export ORACLE_HOME=/orahome/app/oracle/product/10g export PATH=$ORACLE_HOME/bin bk=`hostname` echo $bk it gives error hostname not found if I comment both export line it works fine Can anyone tell me why is it so ?????? Thanks Vrgurav

Member Avatar for masijade
0
92
Member Avatar for flextronics

Hi All, I am new to scripting. I need your help to removing spaces from a string and assign them to different variables. Iwant to call script with one command line argument which is file name which containes different attributes their type and different values eg fdxE1ConfigAdminStatus int 1 2 …

Member Avatar for anil.sivapuram
0
156
Member Avatar for xkmail

I have a small server and want to ban ip address I get alot of spam from. I use fedora 4 with iptables, spamassassin, clamav, and psotfix. I get the line in /var/log/maillog that says: Jul 14 20:52:33 xkmail amavis[15966]: (15966-06) Blocked SPAM, LOCAL [127.0.0.1] [216.22.18.252] <ret@threecurtain.com> -> <miranda@xkmail.hopto.org>, Message-ID: …

0
55
Member Avatar for srinivasocp

Hi All, The following script checks whether the filename is correct then the script proceeds to check whether you have read,write and execute permisiions to the file and displays an approriate message. [CODE]#ss23 #usage ss23 echo "enter any filename \c" read fname if[!-z "$fname"] then if [-r $fname -a -w …

Member Avatar for radoulov
0
116
Member Avatar for abc12345

I have written a shell script for transfering files from ftp1 to ftp2. In ftp1 there can be any number of directories,For eg under sourdedir (mentioned below)there can be any number of directories eg /opt/lampp/htdocs/scrap/test1/ under test1 1.7505-----1.zip 2.2505------2.zip In each of the subdirectories there wilI have written a shell …

Member Avatar for peter_budo
0
153
Member Avatar for vrgurav

How to use mail in mks ? it gives not an internal or external command. can any one solve this problem Thanks Vishal

0
101
Member Avatar for samirs79

I have comma seperated values in a flat file, example below: [B]RStndrd,Mer,1902 PAR GRN,ParentGroup,[/B] I am interested in getting the third parameter from above, ([B]1902 PAR GRN[/B]) in a variable called MyID...i am using the command below to get the third variable [B]MyID=`echo $line|cut -f3 -d ","`[/B] but using the …

Member Avatar for pheeror
0
72
Member Avatar for dude67

Hello all, new to this site and to scripting. I am trying to search for the line with "CALIBRATE" in a file, and remove the leading # from the line with the following lines: cat $F1 | sed -e '/CALIBRATE/s/^#//' > $F1 cat $F2 | sed -e '/CALIBRATE/s/^#//' > $F2 …

Member Avatar for pheeror
0
711
Member Avatar for sgentry6

This is probably just due to my quotes, but I'm trying to get the following script up and running: This is my command line: find ./ -type f | xargs grep "#include <some.h>" | awk -F: '{print $1}' | xargs grep "#include <another.h>" I'm trying to find a nested header …

Member Avatar for Infarction
0
147
Member Avatar for jethfo

Calling All Shell Scripters, I am a web developer needing assistance from someone with shell scripting expertise. Does anyone have a unix shell script that can look into a directory and identify any "*.zip" files and ftp them to a remote server? Upon successful completion of the FTP transfer I …

Member Avatar for tabish.asm
0
129
Member Avatar for samirs79

Hello everyone! Below is a sample flat file (sampleflatfile.dat) i have on UNIX: [COLOR=#000000]AMPS,2324,Subscriber,Unknown,SingleDay,20070413,20070413,[/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000]ALPEnt,4516,AllMember,Unknown,DateRange,20070411,20070419,[/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000]AGLT,2156,Summary,Unknown,[/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000]DUPP,2536,Yes,Unknown,[/COLOR] each line above represents a report to be generated...therefore, the content of the sample flat file above means we need 4 reports (because there are 4 line)... the file above …

Member Avatar for vishu.awate
0
122
Member Avatar for jethfo

I need a robust shell script fast and don't have time to learn how script it myself from scratch. Summary: An existing PHP Application allows consumers to place an order for a product and upload files necessary to build that product. These files are stored in folders on the webserver …

Member Avatar for AHbrendan
0
117
Member Avatar for rockysfr

Hi all, Am having some weird problems with the Korn Shell that has left me puzzled for days... Consider having a line which resembles this in your script file: ssh username@host "command" ie. ssh rockysfr@localhost "ksh" This should put you in the ksh environment. Now, the strange thing is that …

Member Avatar for vishu.awate
0
76
Member Avatar for sandy_b76

Hi All Gurus, I am new to scripting.. and want to know what is the meaning of each non zero exit codes from 1-255. Please help. Thanks in advance Sandy_b76

Member Avatar for sandy_b76
0
169
Member Avatar for rusman

How can i get awk to separate the output with dashes? A simple awk '{print $1-$2-$3}' does not work.

Member Avatar for rusman
0
107
Member Avatar for jeromefong

I'm writing a Bash script to read from an input file and write my changes out to an output file. I'm using read and for some reason, it is stripping the leading spaces off of each line. I didn't see any flags in read to turn the stripping off. I'm …

Member Avatar for radoulov
0
160
Member Avatar for cbedard

Hi All, So I'm brand new to Visual Basic and am VERY confused. Lets set a few constants... OS: Win XP. Variations of Visual Basic on my PC: 1. Visual Basic run through the Sax Basic Engine Version 5.1. This runs files with a .bas extention and is run from …

Member Avatar for cbedard
0
130
Member Avatar for Toktam
Member Avatar for vrgurav
0
263
Member Avatar for Toktam

[B]Hi everyone, Is there any option for rm to remove a directory with no prompts?Actually I know about rm -r but by this option I have to answer lots of questions... Cheers, [/B]

Member Avatar for vrgurav
0
135
Member Avatar for phalaris_trip

I basically need to write a program that will display all images in a directory, sequentially, and either create or open an existing corresponding text file, and allow a user to write/dictate into it. (e.g. So working in a directory containing one.tif, two.tif and three.tif, the program will open/create one.txt, …

Member Avatar for phalaris_trip
0
181
Member Avatar for TheDonDon

I'm completely new to this and have fallen at the first hurdle.:( I'm only playing so its not urgent. Here is my little bit of code: #!/bin/ksh print Content-type: text/html print print '<pre style=font-family:Fixedsys>' [B][COLOR="Red"]gtacl -c 'files $usvol1.ssdxl' [/COLOR][/B]|{ while read line ;do print "${line%%=*}" done } print '</pre>' Don't …

Member Avatar for TheDonDon
0
182
Member Avatar for 6figganigga

Hello, I'm fairly new to Linux and have managed to make this script below work. Basically it gets my current external ip and emails it to me. It works great as a cron job daily but I was wondering if some of you guru's may be able to augment this …

Member Avatar for 6figganigga
0
88
Member Avatar for le0pard13

Situation: I have a working shell script on our file server (OSXS Tiger) to connect to a workstation, which is using a portable home directory (phd), and rsync a user's MirrorAgent.log. I'm not that strong of a scripter, but I would like to add other workstations to this script as …

Member Avatar for le0pard13
0
153
Member Avatar for punnoose0607

Hi, I'm trying to shell script crontab commands, so that users can execute those by keeping the script inside the sudo menu. Users need to do this since they have only sudo access. Our server env is set in such a way that only root users can run crontab utilities. …

Member Avatar for thekashyap
0
86
Member Avatar for Im_a_Student

How would you set the default umask value for normal users if you are working in a typical business company as a system administrator? and Why? Tell me what you think!

Member Avatar for thekashyap
0
83
Member Avatar for ssiva

I need an awk script to do the following things, please help me. Here is a scenario. I have a text file which I usually be editing in NEDIT, I have to select the text (basically pair of points- like a 2 column data points) then through customised shell menu …

Member Avatar for thekashyap
0
99
Member Avatar for Toktam

[B]Hi guys, I'm trying to write a makefile but it keeps giving this arror: ***missing separator. stop. Actually I start a new line with tab,but it seems there are some space chars there, I'm using vim,how can I start a new line with tab??? Thanks alot :) [/B]

Member Avatar for thekashyap
0
68
Member Avatar for SmileSmita

hi there, i am looking for some sample shell scripts where i could run this shell scipt after my backups are done and are lying in the directory. what i want to accomplish is: to run the script after the backups are done and to delete the past tar files …

Member Avatar for thekashyap
0
84

The End.