Re: Using echo in Bash
From: half_pint (esboella_at_yahoo.com)
Date: 08/29/03
- Previous message: SD: "Re: Newbie questions (a few topics) for HP Omnibook 6100"
- In reply to: Martin Jeppesen: "Re: Using echo in Bash"
- Next in thread: Martin Jeppesen: "Re: Using echo in Bash"
- Reply: Martin Jeppesen: "Re: Using echo in Bash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 29 Aug 2003 17:37:38 +0100
I get the general idea of the problem (I think), I am thinking "get
the filenames into a text file, edit it with a text , then turn the file
into a script
to do rhe renaming for you"
-- regards half_pint "Martin Jeppesen" <7t1tng0mgq02@sneakemail.com> wrote in message news:pan.2003.08.29.13.16.37.837734@sneakemail.com... > > I think I know what you mean, and my answer would be probably not, > > well easilly anyway. > > Do you want like a box to fill in on the screen, with a default value in > > it, which you can edit, and then presumably read into a variable? > > Exactly=) > > > I think basically you need to be able to read what is on the screen > > directly, and I am not sure if you can do this with a 'dumb' terminal, > > as it reads what you type, NOT what is on the screen, I believe. > > Doesn't the 'read' command do that? > > Isn't it the 'echo' command that have to do be able to echo editable text? > > > You would probably need a small C program to do this for you, > > using 'cursors'??? > > > > I could probably 'knock one up' if I had the time. > > Thanks for you kind offer=) I considered Perl myself, but perhaps even in Perl this would > course the same problem? > > > Prehaps it will be easier to ' change the problem'. > > If you describe what you are trying to do and *why* someone may be > > able to suggest a solution. > > Sure=) I have made this little Bash script that converts MusePack (mpc) music > files to OGG Vorbis. For testing MusePack and Vorbis are not needed. > > Inorder to get correct file names and tags, I have to reenter the > artist,album, song title and track number myself=( > > The artist and album is only set once, as these are the same for all the > songs. But the song titles are all different. So right now I prompt the > old file name to the screen(fx. 04 - Led Zeppelin - Stairway to > Heaven.mpc), and paste only the title using the mouse. > > It would be much faster if I could edit the text on screen, and press > enter, so only the title was left. > > The script is called repack, and works by writing: > ./reapck file1 file2 file3... > or > ./repack * > > > > #!/bin/sh > > # This script converts MusePack (mpc) music files to OGG Vorbis at quality 4. > # Date of creation 26/08-2003. > > # Define constants for the entire repack > echo > echo -n "Enter artist name: " > read ARTIST > echo -n "Enter album name: " > read ALBUM > > # the repack one by one > for arg in "$@" > do > echo -n "Current filename is: $arg" > echo > echo -n "Title: " > read TITLE > echo -n "Enter track number: " > read NUMBER > mpc "$arg" - |oggenc -q 4 --artist="$ARTIST" --album="$ALBUM" --title="$TITLE" --tracknum="$NUMBER" -o "$NUMBER - $TITLE.ogg" - > done >
- Previous message: SD: "Re: Newbie questions (a few topics) for HP Omnibook 6100"
- In reply to: Martin Jeppesen: "Re: Using echo in Bash"
- Next in thread: Martin Jeppesen: "Re: Using echo in Bash"
- Reply: Martin Jeppesen: "Re: Using echo in Bash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|