Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6610321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:49:33+00:00 2026-05-25T19:49:33+00:00

Just learning Automator here, but I’m trying to run a convert command on a

  • 0

Just learning Automator here, but I’m trying to run a convert command on a file (blah.rtf->blah.mobi) and I’d like to take the resulting .mobi file and run another shell command on it in a different action. Either that, or is there a way to set it as a second variable and act on it in the same action?

Here’s my code so far (using Calibre command-line tools):

First action:

for f in "$@"
do
    ebook-convert "$f" "$f".mobi
done    

I’d like to pass that .mobi file to run:

for f in "$@"
do
    mv "$f" $(echo "$f" | cut -d'.' -f1).mobi
done

Any thoughts? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:49:34+00:00Added an answer on May 25, 2026 at 7:49 pm

    In order to pass the converted files to subsequent actions, the first action must output their paths:

    for f in "$@"
    do
        ebook-convert "$f" "$f".mobi
        echo "$f".mobi
    done
    

    But you can make it much simpler by making the first action create the files with the correct names in the first place (as @tripleee suggested):

    for f in "$@"
    do
        ebook-convert "$f" "${f%.*}".mobi
        # echo "${f%.*}".mobi  # optional -- uncomment if you need to pass the files on to subsequent actions
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im just learning mod_rewrite and regex stuff, and what I'm trying to do is
I'm just learning about SVG, and it seems great but I'm not sure about
I'm just learning asp.net mvc and I'm trying to figure out how to move
Im just learning the ropes with javascript and jQuery but cant get my head
I'm just learning about SproutCore now, seems great. But I can't find a good
I am just learning sql and starting with PostgreSQL. Here is what I am
I am just learning scheme, but I would love to be able to repeat
Just learning CakePHP and its Bake feature. I tried to run ../cake/console/cake bake from
I'm just learning C++ and started using different libraries, like Boost and SDL. After
just learning as3 for flex. i am trying to do this: var someNumber:String =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.