Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-22-2006, 03:34 AM   #1
Registered: Apr 2004
Location: Baltimore, MD
Posts: 681

Rep: Reputation: Disabled
bashrc alias issue

I have this alias in my .bashrc

alias burncd='cdrecord -v -pad dev=/dev/sdb $1'

it takes $1 as the file name to be burned. I was wondering how I could write it such that if someone forgets to give the name of the file, it will display "Error: please give the file name"

something like this -

$ burncd
Error: please give the file name to be burned.
Old 08-22-2006, 05:24 AM   #2
spirit receiver
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
You can use a function instead of an anlias:
function burncd {
    if [ ! -r "$1" ]
      echo "Error: please give the file name"
      return 1
    cdrecord -v -pad dev=/dev/sdb "$1"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
using 'watch' on an alias in .bashrc slackist Linux - General 11 01-29-2016 01:09 PM
adding perm. alias to .bashrc Lleb_KCir Linux - General 7 12-09-2004 02:35 PM
My first alias in .bashrc...'apostrophes 'getting' in the way?' Baix Linux - Newbie 3 06-17-2004 02:36 PM
alias and .bashrc whaase Linux - General 3 11-02-2003 07:03 PM
alias and bashrc Haldir Linux - Newbie 3 06-14-2002 05:11 PM

All times are GMT -5. The time now is 03:44 PM.

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