72 Topics
|
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
does anyone know how to add one to an integer with bash? I tried ++$i (name of the integer) |
|
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 … |
|
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 … |
|
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 … |
|
-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 … |
|
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 … |
|
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. |
|
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 … |
|
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 … |
|
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 … |
|
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 [ … |
|
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 "-------------" … |
|
|
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? |
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 … |
|
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 … |
|
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) … |
|
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 … |
|
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 … |
|
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 … |
|
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. |
|
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 … |
|
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 … |
The End.