Total noob script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Total noob script
# 1  
Old 04-24-2011
Total noob script

Hi i am a total noob at shell scripting. i was wondering if somebody could help me with my script.
i want the script to search the dev folder for the burner file
because they are different between distrubutions? as i under stand it.
this i the script.
Code:
#!/bin/bash
echo "Script för att bränna 360 spel med growisofs"
f_pause(){
  read -p "$*"
}

echo "Tryck på enter för att fortsätta!"
f_pause "Eller för att avbryta ctrl-c"
iso=$1
abgx360 -af3 ${iso}
f_pause(){
  read -p "$*"
}

echo "Är allt ok?"
f_pause "Tryck på enter för att fortsätta!"
growisofs -use-the-force-luke=dao -use-the-force-luke=break:1913760  -dvd-compat -speed=4 -Z /dev/dvdrw=${iso}
echo "Tackar för att ni använt mitt script!:p"

where it says dvdrw now i want the script to probe for the file
and exchange it with the one the distrubution is using

Cheers
ps. sorry for bad english.

Last edited by Scott; 04-24-2011 at 03:07 PM.. Reason: Please use code tags
# 2  
Old 04-24-2011
why are you declaring f_pause twice? declare it once, then just use it, like a command.

Where do you expect $1 to come from? A commandline parameter or the read?
# 3  
Old 04-24-2011
i use it like this. ./test.sh test.iso
so thats a commandline parameter right?

Actually i dont relly know what every thing does or how to really use them.
as i stated in the title i am a total noob on shell scripting.

i just found something thru google and it worked.
but if somebody thinks that it should be better another way
feel free to change it to youre liking and post itSmilie.

i tried to make the script break if abgx360 encounterd
any problems. but couldet find any helpful information.
to make i do that.

cheers

Last edited by MatsO; 04-24-2011 at 04:31 PM..
# 4  
Old 04-24-2011
Quote:
Originally Posted by MatsO
i use it like this. ./test.sh test.iso
so thats a commandline parameter right?
Yes.
Quote:
I tried to make the script break if abgx360 encounterd any problems. but couldet find any helpful information. to make i do that.
Code:
if ! abgx360 -af3 ${iso}
then
        echo "problem"
        exit 1
fi

# 5  
Old 04-24-2011
Thank you.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Noob question: How to check the total number of inputs entered by user?

Say I have this line: read -p "Enter 3 numbers: " num1 num2 num3; I want to write a while loop that repeatedly asks for input if the number of inputs entered is not equal to 3. I don't know the correct command to find the number of inputs entered. Help, please? (4 Replies)
Discussion started by: jejemonx
4 Replies

2. Shell Programming and Scripting

Total Noob BASH scripting question

Hello All, I have a file of ip addresses called activeips.txt What I'm trying to do is run a simple bash script that has a loop in it. The loop is a cat of the IP addresses in the file. The goal is to run 2 nmap commands to give me outputs where each address in the list has an OS... (11 Replies)
Discussion started by: Dirk_Pitt
11 Replies

3. Shell Programming and Scripting

Need help with simple script (noob)

Hi This is my first time attempting a bash script, or any kind of programming. I'm trying to get a clear picture but it helps to work backwards. It would be greatly appreciated if someone could show me what this script would look like... Write a script that displays todays date in... (1 Reply)
Discussion started by: earthicle
1 Replies

4. UNIX for Dummies Questions & Answers

Is there any way of splitting the script (Noob Here).

I m writing a script to check Server Hardening. The problem is whenever i add new point it grows and it become very tedious to edit the script file. Is there any way of making them separate and call them from one base script? Is it possible to define global variable that can be accessed via... (5 Replies)
Discussion started by: pinga123
5 Replies

5. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

6. Shell Programming and Scripting

Noob needs script help Grep

while read s1 s2; do grep -i -w $s1 6-29data | tr "" "" | sed 's/^*,//' | sed 's/200906/2009-06-/g' >> $s1.txt ; cat header > here ; cat $s1.txt | sort | uniq | tac >> here ; cat here | uniq > $s1.txt ; done < list Wow this almost worked file list has 8000 stock symbols which are... (4 Replies)
Discussion started by: harte
4 Replies

7. Shell Programming and Scripting

Noob, script formatting query

Hi all, im new to the forums and i hope im not asking a heavily posted Q but here goes. I use the following script to do a simple calculation, the problem is, the data i receive is in the form of numbers with commas i.e. 1,000,000 This code below wont recognise the commas so i have to remove... (2 Replies)
Discussion started by: benjo
2 Replies

8. Shell Programming and Scripting

Why does my script not work? (Noob Alert)

I am a scripting noob and I have tried to search on google, but cannot find the answer as to why this script doesn't work properly. The idea of this script is that it will list all files starting with f in a certain folder, and delete all but the three newest one. I am trying to achieve this by... (4 Replies)
Discussion started by: bronkeydain
4 Replies

9. Shell Programming and Scripting

noob. need help to create a script.

Hi All. im a noob to scripting. could somone help me with a script please. what i want to do is. 1. run a cmd in the script - qmqtool -s this will give me an output similar to this. Messages in local queue: 790 Messages in remote queue: 306 Messages in todo queue: 23 i then want... (1 Reply)
Discussion started by: aron
1 Replies
Login or Register to Ask a Question