LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 03-03-2016, 02:58 PM   #1
Pandapoke
LQ Newbie
 
Registered: Mar 2016
Posts: 13

Rep: Reputation: Disabled
Bash scripting with dd


Hi im trying to do a bash script that are using bash

Code:
#!/bin/bash
#set -vx
speed=512K
while true
do

    clear
    echo "============================="
    echo "    Burning menu using dd    "
    echo "============================="
    echo "Enter 1 for full path to iso."
    echo "Enter 2 for media"
    echo "Enter 3 to set bs speed 512K default"
    echo "Enter 4 to execite dd command "
    echo "Enter q to exit q:"
    echo -e "\n"
    echo -e "Enter your choice \c"
    read -r choice
    case "$choice" in
        q) exit ;;
        1) echo -e "Enter path to iso \c"
           read -r iso ;;
        2) echo -e "Enter device"
           read -r device ;;
        3) echo -e "Enter bs speed \c"
           read -r speed ;;
        4) echo "Going to format $device, are you sure (y/N)?"
           read ans
        if [[ "&ans" != "y" && "&ans" != "Y" ]]; then
            echo "Clearing screen"
            sleep 3
            clear
            "dd if=$iso of=/dev/$device bs=$speed"
            echo "Burning please wait"
            sleep 30
        fi
    esac
done
but when i execture "4" to use dd command i get this output
Quote:
./burn2.sh: line 33: dd if=~/Downloads/OS/Linux/Dists/m.img of=/dev/sdb1 bs=512K: No such file or directory
There is such file and i have tried with other iso:s and img:s

can anyone help a beginner?
mvh

Thanks in advance.
 
Old 03-03-2016, 03:30 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Continue here:
http://www.linuxquestions.org/questi...er-4175573687/
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Shell Scripting Part I: Getting started with bash scripting LXer Syndicated Linux News 0 04-29-2015 08:03 AM
Bash Scripting – Code Structure - Defining Multiple Points Of Entry In Bash Script carlr Programming 10 08-25-2014 02:38 AM
[To share Bash knowledge]Notes for Advanced Bash-Scripting Version 10 (Latest) jcky Programming 4 07-31-2014 09:24 AM
LXer: Bash If statements, Exit Status and Comparison Operators, A beginners guide to bash scripting LXer Syndicated Linux News 0 06-29-2014 07:35 PM
Reading a bash variable in bash scripting problem freeindy Programming 3 11-27-2008 02:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration