72 Topics

Member Avatar for
Member Avatar for Akusa

I have to write two scripts, one in bash and one in dos. My dos one works perfectly but I'm having trouble with my bash one. The assignment is to make a script that takes a command line argument (from a test script) and return the change. So if the …

Member Avatar for dfl1954
0
404
Member Avatar for replic

Hello everyone, i am fairly new to shell scripting so please bear with me. The following script is supposed to read words from a file and depending on the word print different things. However it always prints the default value. It also refuses to work completely if the first line …

Member Avatar for replic
0
332
Member Avatar for jpreem

So Im using our university servers through an ssh connection. I have a bunch of files in a directory which I would like to run through a perl script. So I thought this simple script I concocted should do the trick. I have used similar script on my home computer …

Member Avatar for TylerD75
0
297
Member Avatar for jdm

I'm almost done with college and I want to work on a side project that I could use to show case my skills. I'm looking for something that I can combine a bunch of different aspect into one. I know this will be a big project and won't be able …

0
175
Member Avatar for it@61@sec

I have a bash script (test.sh) which reads parameters from the command line. The parameters could look like this: param1 param2 param3&ext param4 param5 The problem is that when the script reads the parameters and then echo them I get the following: param1 param2 param3 No command 'ext' found did …

Member Avatar for it@61@sec
0
966
Member Avatar for amnakhan786

hi, i am trying to parse a collection of text files that look like following. there a number of them but not all are structured exactly the same way.if i figure to parse this file i can handle the rest.i am novice in bash, and i want to parse the …

0
94
Member Avatar for saltex

Hey all, Wanted to ask a question about the guest profile on Mountain Lion. I have always been a little insecure about changing and adding new feats to the terminal, so I'm trying to figure out a way that I can be *more* secure. I have recently edited both bash …

Member Avatar for macmad
0
265
Member Avatar for 24x24

Hello All, This may be the wrong place for this and if so I apologize in advance. I have been tasked with organizing a drive full of marketing assets on a mac server. It is currently in use so we have made a duplicate share so that any changes will …

Member Avatar for L7Sqr
0
185
Member Avatar for Sanchixx

does anyone know how to add one to an integer with bash? I tried ++$i (name of the integer)

Member Avatar for L7Sqr
0
119
Member Avatar for niallpaterson

Hi, I've never used bash before, but am creating a file. Here's the skelton: while read line; do if [ -e "$line" ] then else cat > $name << EOF EOF cat > rails << EOF EOF fi command $name & done < projects.txt The error is: "line 55: syntax …

Member Avatar for Watael
0
216
Member Avatar for iamthesgt

I am using Awk inside a bash shell script to search header files for c++ functions so I can add these functions to another file. All of the functions I need will have form: type getName() or type setName(type value) Right now I get all the functions listed in between …

Member Avatar for iamthesgt
0
447
Member Avatar for John Linux

Hi, I am trying to write a Bash Script to sort some images but I am new to Bash and not having any luck. I have a folder of images. Example: P100.jpg P172.jpg P342.jpg P400.png I need to change these filenames to <filename>_DEFAULT<extension>. ie. P100_DEFAULT.jpg and then move the file …

Member Avatar for KenJackson
0
235
Member Avatar for matharoo

-53 45 -54 43 -55 42 -56 41 -57 40 -59 37 -61 35 -61 36 -62 34 -64 33 -65 31 -65 32 -67 30 -68 29 -69 28 -72 25 -73 23 -73 24 -74 22 -76 20 -76 22 -78 20 -79 18 -80 17 -81 16 …

Member Avatar for b1izzard
0
249
Member Avatar for John Linux

Hi, I am trying to write a Bash Script to sort some images but I am new to Bash and not having any luck. I have a folder of images. Example: P100.jpg P172.jpg P342.jpg P400.png I need to change these filenames to <filename>_DEFAULT<extension>. ie. P100_DEFAULT.jpg and then move the file …

Member Avatar for histrungalot
0
248
Member Avatar for diocode

I'm looking for a command or bash script that will create an index.html file in every directory and subdirectory starting at the current directory. I would like it to prompt to overwrite so I don't delete a good index.html file.

Member Avatar for cfajohnson
0
140
Member Avatar for joehms22

I've got some terminal session log files that I'd like to record in a video file, anyone know a good way to do this? Preferably it would be scriptable and not need X to be running so the server could do it automatically to these logs as they arrived. The …

0
161
Member Avatar for tap3ah

I'm trying to write a bash script that converts html file into latex file by processing each line with sed. I'm stuck with following issue: I need to replace [ICODE]<a name="[I]something[/I]">[/ICODE] with [ICODE]\index{[I]something_else[/I]}[/ICODE]. I have an associative array with key-value pairs like this: [ICODE]"[I]something[/I]" => "[I]something_else[/I]"[/ICODE]. However, there are 2 …

Member Avatar for tap3ah
0
188
Member Avatar for matharoo

I am trying to plot a graph using expect in my script and want to change the range of x and y axis. my script processes all the commands but when it comes to axis([1 5 1 10], 'normal']) command it give out the error following error : [CODE]octave:1> x …

Member Avatar for matharoo
0
204
Member Avatar for matharoo

Hi I am trying to write a script in Bash Shell. I have the file test.txt and has the following data: AIR DR [ 4] Pressure :50 AIR UR [ 3] Pressure :70 WATER DR [ 3] Pressure :90 [ 3] PIS: 402ps WATER UR [ 3] Pressure :110 [ …

Member Avatar for L7Sqr
0
326
Member Avatar for Rizzuti

Hi, I'm trying to check if the user that im deleting exist in the database before deleting them, but it does not recognise the id (delID) the second time that i enter the id (even if it is right). Any suggestion [CODE]delete(){ clear echo "-------------" echo "DELETE RECORDS" echo "-------------" …

Member Avatar for Pjieter
0
176
Member Avatar for Johnbonono

I want to make a bash script that will run every time my computer wakes up from sleep. I will be leaving it on and logged in all the time, so a login script would be useless. Is there a certain file name I can give it or something?

Member Avatar for L7Sqr
0
112
Member Avatar for dancks

I was supposed to write a program that reads and writes phone numbers of people to a file called phones.txt. The reading part works. The write part doesn't. I tried to use the cat command because I thought doing cat >> file.txt would simply append to a file. What it …

Member Avatar for dancks
0
370
Member Avatar for iamthesgt

This is homework. I have to write a bash shell script using awk to process three delimited text files and produce a formatted report. The three files are as follows: [CODE]GRADES file John Bunyan:90:100:75:60 Maria Montessori:80:90:60:82 Alice Cooper:75:80:54:47 Harvey Mudd:89:45:89:95 PROJECTS file test1:30 test2:30 paper2:20 exam:50 LEVELS file A:89.5 B:79.5 …

Member Avatar for Fest3er
0
296
Member Avatar for mikeandike22

input and returning the input: output. Here is the assignment In the session, provide a command prompt that includes the working directory, e.g., $./logger /home/it244/it244/hw8$ Accept user’s commands, execute them, and display the output on the screen. During the session, create a temporary file “PID.cmd” (PID is the process ID) …

Member Avatar for mikeandike22
0
241
Member Avatar for iamthesgt

This is homework. I was writing a bash script that accepts a list of group names on the command line and produces a group report detailing the group id and the number of group members identified in /etc/passwd for each group. Output will look like: Group Report Group GID Count …

Member Avatar for iamthesgt
0
302
Member Avatar for Sudo Bash

Hi, I was wanting to write a (ba)sh script to allow me to wait for the detection of a new USB device, and when that device is detected, execute some commands. The scripts are intending to be working on the principle that whenever I plug in a usb device a …

Member Avatar for Sudo Bash
0
240
Member Avatar for Borzoi

I currently have a small script I've written that basically takes an incremental backup of a folder which looks similar to this: [code] #!/bin/bash cp -ruf /home/folder4/subfolder/ /home/folder5/ cp -ruf /home/folder3/subfolder/ /home/folder4/ cp -ruf /home/folder2/subfolder/ /home/folder3/ cp -ruf /home/folder1/subfolder/ /home/folder2/ [/code] Now this runs fine, only updating the files that …

Member Avatar for JeoSaurus
0
206
Member Avatar for winecoding

I am trying to understand one test script, which includes [CODE]if [ ! -f mahout-work/reuters21578.tar.gz ]; then echo "Downloading Reuters-21578" curl http://kdd.ics.uci.edu/databases/reuters21578/reuters21578.tar.gz \ -o mahout-work/reuters21578.tar.gz fi[/CODE] What does the condition of [CODE]! -f mahout-work/reuters21578.tar.gz [/CODE]mean? And what does [CODE]curl http://kdd.ics.uci.edu/databases/reuters21578/reuters21578.tar.gz \ -o mahout-work/reuters21578.tar.gz [/CODE]stand for? Thanks.

Member Avatar for alaa sam
0
242
Member Avatar for kristo5747

After running the command [CODE] find . -name "R*VER" -mtime +1 -exec sh -c 'grep -H ^err "{}" || echo "{}:No error"' \;[/CODE] my files look like this [CODE] RRR1~COS~COSMETICS~40048~jgmdtv113~1~P~R22-200~029053662549~20110607~102151.VER No error RRR1~COS~COSMETICS~ETT03~jgm14652.~3~F~R16-500~000907009757~20110607~085109.VER err 3922 [/CODE] Using the tilde (~) symbol as delimiter in the file name, can I extract …

Member Avatar for kristo5747
0
207
Member Avatar for airbourne

I am writing a simple shell script to automate a simple backup of a website and it's database. This is the working code: [CODE]#!/bin/bash # creates a backup of the mysql & webdata for a specific website. TODAY=`date +%A` # these variables cannot contain any spaces and must be modified …

Member Avatar for L7Sqr
0
698

The End.