1,892 Topics

Member Avatar for
Member Avatar for iceman29

Hi, I am writing a shell script, and need help with a small piece of code. It is as below: [code] CUST_1=filename b=1 c=$CUST_$b echo $c [/code] I want the output from this as filename, whereas I get it as 1. Please guide as if where am I going wrong …

Member Avatar for iceman29
0
125
Member Avatar for Windkessel

Hi everyone, I'm trying to figure out how to pipe a filepath to the open command in TC Shell. What I'm trying to do is, to pipe the outcome of "which" (to find the current location of another script) to the default text editor. I tried [icode]which testscript.pl | open …

Member Avatar for Windkessel
0
139
Member Avatar for samarudge

Hi, I have a shell script that is supposed to change the permission for my WWW folder so that Apache can access them. My current script is [CODE=shell]chown apache /var/www/* chmod 755 /var/www/*[/CODE] This works fine for /var/www/ but subdirectories of /var/www/ e.g. /var/www/html/ is still owned by samarudge (My …

Member Avatar for samarudge
0
91
Member Avatar for waphon

@REM By unknown @echo off color 0A %~d1 cd %~p1 set _source_= set _dll_= :LOOP if "%1" == "" goto COMPILE if /i "%~x1"==".cs" goto SOURCE if /i "%~x1"==".dll" goto DLL goto SFT :SOURCE if "%_source_%"=="" goto S2 :S1 set _source_=%_source_% %~nx1 goto SFT :S2 set _source_=%~nx1 goto SFT :DLL …

Member Avatar for Ancient Dragon
0
121
Member Avatar for shyamalaa

Hi sed -f /opt/DBACheck.sql.sed /opt/DBACheck.sql > /opt/DBACheck.sql.tmp mv -f $DBACheck.sql.tmp $DBACheck.sql where the contents of DBACheck.sql.sed is { s%${DBMS_USER}%SYSTEM%g } DBACheck.sql is a one line file , that contains line with string DBMS_USER which i want to replace it with SYSTEM. But on executing i get DBACheck.sql to be an …

Member Avatar for shyamalaa
0
286
Member Avatar for scottyscotty19

Hi. I have created a script that works perfect but I am now told that I could have done it better, but how? This is an example of how I did mine: #!/bin/bash # function users { echo "1. Password file" echo echo "Enter num: " read usernumber if [ …

Member Avatar for scottyscotty19
0
127
Member Avatar for rusman

I want to ls -l a filesystem, but only want the files 3 months old or more. I can't figure out how to test the files and get the results I'm looking for. Any ideas?

Member Avatar for Salem
0
97
Member Avatar for blueman

Hi all i'm hoping someone can help here my son is doing a school project and he's doing really well, he loves his computers, his project as come to a dead end as we're struggling to create a menu which will add users doing this in Bash. then adding a …

Member Avatar for JeoSaurus
0
99
Member Avatar for rational611

Hi, I want to write a reg file which will enable me to install firefox add-ons (xpi files) by clicking my mouse on the add-on file itself without having to drag and drop the add-on into the firefox window. Could someone help me on how to do this ? Thanks

Member Avatar for roman123
0
63
Member Avatar for daviddoria

I have to call this many times: [code] MyScript.py --top='?_0.png' [/code] where the 0 should be replaced with 0, 1, 2, 3, etc I tried this: [code] for i in {0..3}; do echo MyScript.py --top="'?_${i}.png'"; MyScript.py --top="'?_${i}.png'"; done; [/code] It seems to make the command look correct (ie the single …

0
62
Member Avatar for externalaw

I need to put some static pages into a mysql table This is a sample static page HTML Code: <title>acquital</title> <meta>acquital</meta> <type>lawglossaryitem</type> To be acquited of a crime is to be deemed to be innocent of the charges after a court hearing. This is different from a <a href=lawglos_Discharge.html>Discharge</a>, where …

0
70
Member Avatar for sfzab

I work and have to save an important file in four other locations besides a Linux HD. Instead of having to save the same file for four more times, I would like to automate the procedure through a linux script file in which the [B]first[/B] saved file on the Linux …

Member Avatar for sfzab
0
321
Member Avatar for externalaw

OK, Please advise me, I have 1500 pages of static pages, each with content related to a keyword. I have the list of keywords and copy those in a column in excel, Then I upload the 1500 pages of content And i do this get file wget -i ./1 and …

0
58
Member Avatar for siul0_0

Hi there!! My first Post :) My problem is as follows: I have multiple text files in a folder, and I need to automatically format these text files to an CSV format. At the same time I need to add different Data to accommodate it to the MySQL database. so …

Member Avatar for mittelgeek
0
138
Member Avatar for externalaw

Hello all, I have 2 questions.. I have just been given 1500 pages of static html pages nicely organized, each page with 1 keyword (title of the page) and the information within the page. I want to do two things with this and I am STUCK.. 1) about half the …

0
56
Member Avatar for daviddoria

I found some code to parse command line arguments (is there an easier way? sed always seems so complicated...) [code] #!/bin/bash for i in $* do case $i in --files=*) FILES=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` ;; --default) DEFAULT=YES ;; *) # unknown option ;; esac done echo $FILES echo "File …

Member Avatar for hexram
0
110
Member Avatar for devill

Can u please help me in implementing lfu and mfu paging algorithms? using shell programming output of the program should give1) no of page faults occured and 2) the final state of page

Member Avatar for devill
0
31
Member Avatar for sprok

I got a "working" script for monitoring Autosys jobs. Basically, it starts with listing all the jobs that are due to run in a "shift". Now, I'm in the part where I want to delete a job/word from a list BUT only the first occurrence of such job name. This …

Member Avatar for sprok
0
107
Member Avatar for AcerAspirant

Hey guys, I'm trying to develop a lightweight chat/email-client between two Linux machines. The point is to make it as barebones-looking as possible, with a 1980s retro aesthetic. Think the green IBM text of the Matrix, or better yet, the game Defcon (especially the intro screen). Or, of course, the …

0
56
Member Avatar for blueman

Hi all i'm hoping someone can help here my son is doing a school project and he's doing really well, he loves his computers, his project as come to a dead end as we're struggling to create a menu which will add users doing this in Bash. then adding a …

Member Avatar for Aia
0
104
Member Avatar for ravikiran032

I have created a dos script which deletes files in "g:/documents and settings/ravi kiran/recent" where my OS installed in g: drive. when i run the script it is promting for Y/N. so I have given input from a file "kiran.txt" using input redirector.But it is not working. the code is …

Member Avatar for rm_daniweb
0
151
Member Avatar for metaface

Hello all, I would like to write a shell script that can scan a directory containing audio files and extract metadata or audio encoding information from the files. The goal is for the shell script to be able to process music files based on embedded data as: Format, Data Rate, …

Member Avatar for ghostdog74
0
510
Member Avatar for leebria

Is it possible to use a variable to do the line addressing for a sed command? I have a list of email addresses and am trying to access them one line at a time to store them in a variable. I need the first portion of the address (up to …

Member Avatar for leebria
0
86
Member Avatar for lehe

Hi, I'd like to pass arguments with space inside to a bash script and further into an executable called inside the script. My bash script looks like: [code] #!/bin/bash ARG_OPTS="" while [[ -n "$1" ]]; ARG_OPTS="${ARG_OPTS} $1" shift done my_executable ${ARG_OPTS} [/code] one of the arguments to the executable is …

Member Avatar for lehe
0
110
Member Avatar for tomtetlaw

i have a few questions 1)Is shell scripting for the windows cmd line? 2)how fast is it? 3)can anyone recomend any tutorials to learn it? any help would be appreciated :)

Member Avatar for fpmurphy
0
88
Member Avatar for externalaw

Hi, I am Mike and run a small law student site, recently I was donated a dictionary and have a glossary system installed on my forum. I am pretty bad with scripting but hope someone can help me along, What I want is to put the dictionary written like this, …

Member Avatar for externalaw
0
144
Member Avatar for lehe

Hi, Here is my code, [code] ids=(1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 90 100 110 120) for ((i=0;i<${#ids};i++)); do awk '{ print ${ids[${i}]}" "$1; }' > ${TMP} < ./results/$1${ids[${i}]}/test_error.dat done [/code] I got this error [quote] awk: { print …

Member Avatar for Fest3er
0
172
Member Avatar for daviddoria

I am trying to do this [code] #!/bin/bash for i in 1 2 3 4 5; do File1="$i.txt" File2="$i.obj" ./Test $File1 $File2 #save i and the result of the program somehow done; [/code] For example, at the end I would like to have a file like this [code] 1 3.4 …

Member Avatar for nucleon
0
162
Member Avatar for joinup

Hello, I need to create a bash script file that zip files. The obj is : the script enter into a directory, see all directories, and zip the files by date ( the script is for managment of logfiles ), exemple: in the directory there is just files following the …

0
54
Member Avatar for Usura

Hey im completely new to bash scripting and have no idea how to search the directory name then print out the path where it was found, the filename is entered thru the command line like "./search.sh pictures" and then would make the script print all directory path names which contain …

Member Avatar for Comatose
0
114
Member Avatar for iggy78

1.Creates a text file that lists the operating system of your computer, the computers name and username. Use appropriate environmental variables. 2.Append to the text file a listing of the files and folders in the current directory. 3.Create a variable called myName and assign your last name to this variable. …

Member Avatar for anonymoose09
0
125
Member Avatar for Bhoot

i have come across a question which asks to write an awk command that displays all records having 2nd and 3rd characters same. i could write the solution in sed, using tagged regular expression, as follows : [QUOTE] sed -n '/^.\(.\)\1.*$/' emp.list [/QUOTE] However, as far as i know, tagged …

Member Avatar for ghostdog74
0
298
Member Avatar for nkjvcjs

I have several hundred files in a directory. The files are named fit###.txt. for example fit001.txt, or fit198.txt, etc. They all have the format # # amp*exp( -1.0*|alpha|*x ) + C # amp: 9.30743e+05 +/- 1.68% # alpha: 0.78858 +/- 0.03033 # C: 0.0 Fixed DATA MODEL exp amp 9.307434e+05 …

0
69
Member Avatar for ashkash

I have a number of files in a folder that are number as 1, 2, 3, 4, 5, 6, etc. I also have a text file in the same folder that identifies each of these numbered files and gives their path location. The text file looks like this: 1 C:\system\Apps\file1.exe …

Member Avatar for mittelgeek
0
420
Member Avatar for chris5126

hi, i am totally stuck i need a script (that works in ksh under solaris 10) that takes the following output [code] d15 509MB c1t0d0s5 d13 7.0GB c1t0d0s3 d11 1.5GB c1t0d0s1 d10 10GB c1t0d0s0 d25 509MB c1t1d0s5 d23 7.0GB c1t1d0s3 d21 1.5GB c1t1d0s1 d20 10GB c1t1d0s0 [/code] and for the …

Member Avatar for Aia
0
245
Member Avatar for ahha0ahha

My system: fedora 7 I have many pictures in multi-page pdf/ps files. I need to use some of them into my slide. I know transfer file between pdf and ps by using pdf2ps,ps2pdf, and I can transfer a single page picture by using ps2eps. My problem: How to transfer a …

Member Avatar for ahha0ahha
0
64
Member Avatar for lml108

Hi, I've a file having some regular expressions. e.g. cat regex.txt [\t\n] abc.*pqr If I write a small bash script as below, while read line do echo -E "$line" done < regex.txt even with -E switch passed to echo the output is [tn] abc.*pqr So the backslashes have vanished in …

Member Avatar for Fest3er
0
86
Member Avatar for lml108

#!/bin/bash echo -e "10\n20\n100\n200" > file.txt number=0 cat file.txt | \ while read line do if test $line -gt 100 then number=$line echo "Inside while loop number=$number" break fi done echo "Outside while loop number=$number" The output of this script is Inside while loop number=200 Outside while loop number=0 Why …

Member Avatar for fpmurphy
0
114
Member Avatar for nikhil.laghave

Hello, I am a newbie and do not have any shell script experience. I am trying to call a script from inside a fortran call using the call system(./script). Now this script runs ok when run from command line, but when called from the fortran call, i get errors for …

Member Avatar for masijade
0
118
Member Avatar for prushik

I wrote a shell script that checks the command line arguments for the "-i" flag. I designed it to run from inside my gui application. I tested my script from the terminal and it runs perfectly, does just what I want and expect. So I ran my gui (which needs …

Member Avatar for prushik
0
163
Member Avatar for yhcheong

Hi friends, I'm newbie to shell script. I wanted to create a shell script which able to write a result for all the telnet connection status. For example, from this machine I want to test the telnet connection (total 100+ servers) with this machine. Any idea how to write this …

Member Avatar for Comatose
0
1K
Member Avatar for rman10

Hello! I am a newbie to scripting and I'm trying to start an application via a bash script after checking to make sure that two condititions do (or do not) exist first. I've attempted to write down what I'd like to do and was hoping someone could point me in …

Member Avatar for eggi
0
168
Member Avatar for chris5126

Hi I have a command that produces the following: [code] /usr/ucb/ps -auxxx|awk '{print $3,$4,$2,$1,$11}'|grep -v 0.0 %CPU %MEM PID USER COMMAND 0.2 5.217405286920 1910 noaccess 0.1 0.1 180 root 0:43 0.1 0.1 686 root 0:41 0.1 0.1 26198 chris /usr/lib/ssh/sshd 0.1 0.1 26767 root /usr/ucb/ps 0.1 0.1 26215 root bash …

Member Avatar for Fest3er
0
2K
Member Avatar for Blackeagle

hey, i've just learnt how to make additional virtual console ( e.g pressing ctrl+alt+f8 ) by changing the /etc/inittab file. i was wondering if i can make another graphical one such as that on ctrl+alt+f7 ?? can i do that from /etc/inittab or its not possible to make it there?

Member Avatar for Comatose
0
98
Member Avatar for snahata

Hi, I would like to add a new column in a text file which contains values based on the value of another column. Eg: suppose the text file contains: 1 abc 67 2 def 40 3 uty 57 ....... .... Now i would like to add a new column which …

Member Avatar for ghostdog74
0
399
Member Avatar for brakeb

Greetings, I have reached a point where I need some help. I have a tivo at home, and I'm trying to script something that will allow me to 1.) pull the XML off of the tivo, and save the file, 2.) Take the text in the XML, and pull out …

Member Avatar for brakeb
0
383
Member Avatar for ImSorry123

Hi All, I am not familiar with shell script and not really have much experience. How to produce a Unix shell script that will display a welcoming message to the current username. Next, the script will show the current directory path, and the extended information of the current directory contents. …

Member Avatar for masijade
0
67
Member Avatar for chadactive

I want to know if there are any good beginner books that cover everything about windows scripting. Please suggest.

Member Avatar for siul0_0
0
73
Member Avatar for lehe

Hi, These days I have to install a higher version of bash under my $HOME on my office server. I hope to make the new bash automatically run both when I ssh to my server and when I boot into my office computer which loads my $HOME on the server. …

Member Avatar for eggi
0
166
Member Avatar for rhesus303

[code] if ! [ -t 0 ] ; then read var fi [/code] I know what the result will be but don't understand the conditional test. I've never seen it before nor can I find the -t option in any shell scripting tutorial

Member Avatar for Fest3er
0
77

The End.