1,892 Topics

Member Avatar for
Member Avatar for titotoms

Hi, I am new to shell scripting.So someone please do help me out.I have stored two dates in the given format below. cur_time=`date '+ %b%e%T'` time=`ls -lu f1 | cut -d "" -f6` I hope both these will show the dates in this format. for eg. Dec 23 10:10 Now …

Member Avatar for jim mcnamara
0
108
Member Avatar for stephan.opitz

i look fo it, but nothing found: i have a variable and want the reverse one example var1="test" var2 will be "tset" under linux shell i have no idea how to do this

Member Avatar for jim mcnamara
0
66
Member Avatar for Lois33

Hi, Inputfile.log TDR 30 /data/data2/log1 TDRM 60 /data/data2/log2 # This command will match both lines $ grep ^TDR Inputfile.log # This command will match lines with TDR word appear anywhere in the text (but not TDRM) $ egrep -w TDR Inputfile.log How can I just match TDR that appears only …

Member Avatar for Lois33
0
89
Member Avatar for sgriffiths

Hello I have a var="STEPHEN,GRIFFITHS" how can i check to see if a variable contains a certain character, ie a comma (,) Thanks

Member Avatar for masijade
0
58
Member Avatar for code321

Hi all... I have just started scripting in KShell and I have this code that extracts information out of a database under different fields. Now, if I further want to refine the data that is being extracted, say matching with a particular term under a particular field, can you please …

Member Avatar for code321
0
91
Member Avatar for yy3

Hi Everyone, I need your assistance to write this script. The script should take an argument of a file. The script should be able to determine what permissions the owner, group and everybody has of the file passed in. The ouput should br displayed similar to this. READ WRITE EXEXCUTE …

0
77
Member Avatar for kamitsin

Hi, Yesterday a friend of mine asked me about the use of $ at the end of the crontab command. His query is something like this. [B]15 3 * * * command [COLOR=red]$[/COLOR][/B] Can someone please help me with the use of $ at the end of this crontab command …

Member Avatar for kamitsin
0
94
Member Avatar for mfeldheim

Hello everybody, I've got a small problem I need the following string to be split into it's parts: [code] ftp://user:pass@host/path [/code] the result should be smth like: [code] $USER = user $PASS = pass $HOST = host $PATH = path [/code] Somebody has help for me? Would be nice Alternative …

Member Avatar for kamitsin
0
98
Member Avatar for goolie

i need some ppl help me in the commmand for connect to my serial port...i face this problem a few days ago but stil unabe to get the solution.

Member Avatar for kamitsin
0
56
Member Avatar for NonProgrammer

Hi everyone, Sorry to be a bother but everything programming seems almost foreign to me. Im trying to write a shell script (using 'sed' and 'tr' etc.) which replaces a string of text with another. That is the easy part. The part Im stuck with is making it case insensitive. …

Member Avatar for sn4rf3r
0
125
Member Avatar for sgriffiths

Hello all I am trying to create a script to do the following: I have a file which contains the following STEPHEN;CHRIS:PETER>JOHN| What i need to do is read this file in and be able to seperate the above names into variables based on the delims. ie Script something like …

Member Avatar for jim mcnamara
0
107
Member Avatar for savage1

Hi, I am new in shell script and I road this script, but it does not give the output I want. The output show look like this: Instance on [COLOR=Red]fac1[/COLOR] [COLOR=Red]inst1 [/COLOR]instance Instance on [COLOR=Red]fac2 inst2[/COLOR] instance Instance on [COLOR=Red]fac3[/COLOR] [COLOR=Red]inst3[/COLOR] instance Here is the script: [code]INSTID="inst1 inst2 inst3" FANCID="fac1 …

Member Avatar for masijade
0
141
Member Avatar for mahul000

Can any1 suggest me, how to implement the "wc" word counting utility through bash shell script, i.e how to design a script working similar to "wc" command ??? Need it desperately, with all relevant options like -l, -c, -w ...

Member Avatar for jim mcnamara
0
133
Member Avatar for tikang

Hi Guys, I'm quite new to shell scripting. I would like to create a script to the following: 1. dbf 2. Print "Filesystem" "kbytes" "used" "avail" "%used" "Mounted on" values where %used >= 80%. 3. email output to user([EMAIL="you@email.com"]you@email.com[/EMAIL]) 4. The script should run once a day via cron every …

Member Avatar for sn4rf3r
0
87
Member Avatar for Deepak Ram

Can anyone help me in implementing a program which contains a routine which is similar to getpid() in functionality, but there should not be use of getpid() in the program. Please reply as soon as possible.

Member Avatar for jim mcnamara
0
95
Member Avatar for badmoons

Greetings, I am trying to create a script that does 2 things. I imagine this can be done in 2 or 3 lines. 1. ssh to a server 2. execute the passwd command here is what I am trying - ssh -l username server passwd Once the script ssh's to …

Member Avatar for badmoons
0
90
Member Avatar for liezer

hi! My boss told me that the script should DISPLAY ERROR if FAILED_LOGIN_ATTEMPTS is greater than 3... HOW should I do THis? PLease talk to me like im moron, im just a beginner... or please give a sample code to do this.. thanx a lot... HERE's THE SCRIPT: export ORACLE_SID=ohkrm92 …

Member Avatar for sut
0
107
Member Avatar for WolfPack

I have an options file of the following format [code] option1 = value1 option2 = value2 ..... ; variable number of options ..... page_size= pagesize1 ;Note there is no space between page_size and = page_size= pagesize2 page_size= pagesize3 [/code] During a regression test I want to extract the values for …

Member Avatar for jim mcnamara
0
174
Member Avatar for sommer_queen

Hello everyone, I am a beginner to shell script . I had to modify the following script and i get the following errors : sag.sh[11]: SAG: not found mv: cannot create /sag_0609131449.txt :Permission denied #!/bin/ksh LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/export/home/oracle/app/oracle/product/8.1.7/lib export LD_LIBRARY_PATH export ORACLE_HOME=/export/home/oracle/app/oracle/product/8.1.7 export STOCK=/export/home/oracle/app/oracle/product/8.1.7/bin export ENT=/home/atw11w99/ent/uc5 #SAG =$SAG:/home/atw11w99/ent/uc5/sag SAG =/home/atw11w99/ent/uc5/sag export SAG …

Member Avatar for sommer_queen
0
118
Member Avatar for zerobreach.com

Hi all, Can anyone shed some light as to why this is not working? for i in `cat wordlist.txt | dos2unix | sed -e 's/ *$//'` do sed -e 's@$i@<a href=http://www.domain.com>$i</a>@g' article.txt done I've also tried: perl -pi -e 's@$i@<a href=http://www.domain.com>$i</a>@g' $file The worlist.txt file consist of words one line …

Member Avatar for sut
0
81
Member Avatar for flextronics

I am new to scripting I want to parse a string in a loop eg A:B:C:D E:F:G:H and put them in different variable attr1 = A attr2 = B attr3 = C attr4 = D . . /* do processing with attr1, attr2, attr3 and attr4 */ then go to …

Member Avatar for sut
0
129
Member Avatar for toztech

Greetings, Hey guys, I am trying to make a shell script that will scan for a certain 5 lines of text in a file, modify it by adding two lines in the middle and replacing that section of text in the file. For example read rc.conf for: Line1 Line2 Line3 …

Member Avatar for sut
0
180
Member Avatar for toztech

Greetings Guys, I am currently creating a frontend for a dropable application in Mac OS, for the backend I am using sh/bash. Currently I have a for look checking to see if it a directory, however I have been unable to find a way to check and see if a …

Member Avatar for sut
0
106
Member Avatar for anshul2181981

Hi I am new to Linux and shell scripting. I have made a script 'script1.sh' in a directory : /root/ansh/scripts I want to invoke this script from any other directory . I understand that for doing this I'll have to set the path of the script in some global variable. …

Member Avatar for John A
0
254
Member Avatar for Alphabeta

Hi!, I'm kinda new to shell scripting, Here's a problem that I have faced and dunno how to solve: First, I want my script to rename the files stored in a .txt file line by line(there's no pattern that I can use with mv, so I want mv to deal …

Member Avatar for jim mcnamara
0
119
Member Avatar for insamniac

Is it possible to retrieve text from an application whose widget handles are unknown? I guess this leads to another question, is it possible to get the widget handles of an application if the only information is the obvious stuff (in the window's title bar)? The user needs to fill …

0
67
Member Avatar for microbiologist

Hi im new to all this but need help. i have a program that runs in the terminal of redhat 9 "./signalp -t gram+ etc" and this produces an output file called output.txt i need a script that will run the command line automatically after the last one finishes and …

Member Avatar for jim mcnamara
0
322
Member Avatar for zunacai

Hello, We have about 430 Linux boxes all over our building, and a single box that we use to ssh in the rest of the boxes (when you ssh from this box no password is required because the keys are on this box). Anyways, my boss asked me to change …

Member Avatar for John A
0
53
Member Avatar for budroedotcom

Ok. This has got to be easy, but I can't get something right. I'm just trying to find a way to enter a few characters (example: cd1) and have it change my current directory. In other words, I'm at root and I want to type cd1 and have it be …

Member Avatar for budroedotcom
0
159
Member Avatar for selvam.cit

hi, i am having two files n.sh here i wrote code like clear f() { echo "this is my program to test function" } again i am having one more file n1.sh here i wrote like this ./home/selvam (this is my program directory (ie.. actual n.sh file is in this …

Member Avatar for John A
0
214
Member Avatar for parani

Hi All, I want to know if there is any way to exit from both the parent and child loop simultaneously without adding any kind of conditional statement. ******************************************************** [COLOR=sandybrown][B]#!bin/ksh a=5 if[[ $a -gt 5 ]] then echo "a=5 and not went to else cdn." else if [[ $a==5 ]] …

Member Avatar for jim mcnamara
0
150
Member Avatar for katharnakh

Hello, I trieng to login to a remote machine, but if I login, and ran command [I]who am i[/I] [I]root ttyp0 Jul 31 06:27 (192.168.1.12)[/I] The problem is why it is showing the IP address, which we usually notice in connecting to a machine which is connected locally (LAN). I …

Member Avatar for jim mcnamara
0
99
Member Avatar for Shadowchaser

Hey everyone, I'm a student at a local community college and working on my last project for the summer. I've been working on this script for the last two days and cannot figure out what I'm doing wrong here. Hoping that some of you might be able to figure out …

Member Avatar for jim mcnamara
0
131
Member Avatar for selvam.cit

hi, if any one give me a code for this output if i give input 4 means i want this output * * * * * * * * * * actually i am not familier with for loop in shell script . so that i ask this help to …

Member Avatar for masijade
-1
54
Member Avatar for chrchcol

I have an index.html file that I need to be able to modify depending on if its secure or unsecure, can I use cat and or grep in a script to modify text in it? Chris

Member Avatar for chrchcol
0
303
Member Avatar for chrchcol

I am using for f in $(<uploads); do s=`echo "$PWD/$f"`; to output the path for each file in a text file. It works great However I need the relative path to start with a specified directory. In other words the top of the script will have a few questions two …

0
101
Member Avatar for blackeyed

My script is giving above mentioned error .... is there any workaround [CODE] #!/bin/sh #################################################################### # Createion Date: 21-Jul-2006 # Modification Date: # Version: 1.0 #################################################################### ############################################################## # Check the parameter ############################################################## if [ "${#}" -lt 5 -o "${#}" -gt 5 ] then echo "Usage for this script is : …

Member Avatar for blackeyed
0
244
Member Avatar for natasha_sr

Hello I have a couple of interlaced images taken from a video stream and I want to do deinterlasing. Unfortunately I don’t have the video. Someone told me that there is a command in Unix that can do this. I would be grateful if you could help me. Thanks,

Member Avatar for jim mcnamara
0
50
Member Avatar for kevin_m

Hi all, I'm trying to "echo" some informations in a while loop, in ksh script. I want to quit, if the user enter some key... Can anyone help me accomplish this task? Thanks

Member Avatar for jim mcnamara
0
107
Member Avatar for Stud33

Hi, I will try to brief as I know some of you will probably see what im trying to do.. What I am trying to do is have the IP address of the machine compare its IP to the IP that is on the server. I am trying to get …

Member Avatar for Stud33
0
77
Member Avatar for lconvoy

Is there any way to view or access javascript portions of a web page from the linux shell? For example, I use curl to pull a web page that has text and javascript. The javascript portion does not show up, just the filename as it is in the source.

Member Avatar for jim mcnamara
0
94
Member Avatar for nihao

Hello all: I want to compare two folders by script like this "diff -yr folder1 folder2",but I find there are two problems in the result which is not what I want,please help me. Problem One: If there are two line is different,and every line is too long, the result will …

Member Avatar for jim mcnamara
0
178
Member Avatar for nileshdalvi

Is this valid in shell programming? tr 'a-z' 'A-Z' < filename>filename note: The filename refers to the same file.

Member Avatar for jim mcnamara
0
62
Member Avatar for rags

I am working as a java programmer and have no experience writing shell scripts or prior experience in UNIX...I would appreciate if someone helps me write a Shell script that: a) Runs from one machine. b) ssh into all of the other machines. c) Collect the cpu% usage from each …

Member Avatar for jim mcnamara
0
422
Member Avatar for alvaro

Hello, I'm trying to write a bash shell script to run some finalization commands on cygwin under Windows XP. I'd like to exit the shell in an automatic way (writing the 'exit' command in the script) but it doesn't work. Do anybody knows a way to do that?

Member Avatar for alvaro
0
97
Member Avatar for girish.sh

Can we define exit status intereger values for our purpose except 0? like can i set custom exit status messages: "1" for error occured because of reason #1 "2" for error occured because of reason #2 ... Is there any document which displays all the exit status code values from …

Member Avatar for masijade
0
134
Member Avatar for girish.sh

Hi all, I am a new joinee in this forum. I am facing one problem. How to call Java classes and methods from shell scripts?? i am using KSH. Is it really possible to do that or not? Response will be appreciated. Thanks, Girish Sharma

Member Avatar for masijade
0
313
Member Avatar for Mushy-pea

Hello everyone:p . Does anyone know what kind of bash script line I could use to copy the contents of a file to the boot sector of a FAT12 3.5" floppy disk? Any help would be appriciated. Thanks. Steven :cool: .

Member Avatar for jim mcnamara
0
65
Member Avatar for vanii

Hi all, I want to know whether "sleep command in shell scripting is a guarenteed command or not " In java 'Sleep() ' is not guarenteed to be called when CPU is Idle. Regards, VANII

Member Avatar for jim mcnamara
0
345
Member Avatar for swmercenary

I have been charged with fixing a ksh93 script which runs on AIX and LINUX. It currently uses getopt to parse command line options, and relies on syntax like: case $1 in -g) FOO =$2 if ($3 == "bar") then BAR= $4 fi etc. Unfortunately, if it is called with …

Member Avatar for jim mcnamara
0
225

The End.