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 7607335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:38:14+00:00 2026-05-31T00:38:14+00:00

I managed to get Ubuntu running on a mobile device. I need to automate

  • 0

I managed to get Ubuntu running on a mobile device. I need to automate some processes on it because user input is totally impossible without a convoluted setup and soldering wires.

I need to run “parted print” and then pipe “yes, fix, fix” to stdin here is the desired output:

~ # parted /dev/block/mmcblk0 print
parted /dev/block/mmcblk0 print
Warning: /dev/block/mmcblk0 contains GPT signatures, indicating that it has a
GPT table.  However, it does not have a valid fake msdos partition table, as it
should.  Perhaps it was corrupted -- possibly by a program that doesn't
understand GPT partition tables.  Or perhaps you deleted the GPT table, and are
now using an msdos partition table.  Is this a GPT partition table?
Yes/No? yes
yes
yes
Error: The backup GPT table is not at the end of the disk, as it should be.
This might mean that another operating system believes the disk is smaller.
Fix, by moving the backup to the end (and removing the old backup)?
Fix/Ignore/Cancel? fix
fix
fix
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be
used, you can fix the GPT to use all of the space (an extra 569312 blocks) or
continue with the current setting?
Fix/Ignore? fix
fix
fix
Model: MMC SEM16G (sd/mmc)
Disk /dev/block/mmcblk0: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name        Flags
 1      131kB   262kB   131kB                xloader
 2      262kB   524kB   262kB                bootloader
 3      524kB   16.3MB  15.7MB               recovery
 4      16.8MB  33.6MB  16.8MB               boot
 5      33.6MB  83.9MB  50.3MB               rom
 6      83.9MB  134MB   50.3MB               bootdata
 7      134MB   522MB   388MB                factory
 8      522MB   1164MB  642MB                system
 9      1164MB  1611MB  447MB                cache
10      1611MB  2684MB  1074MB               media
11      2684MB  15.6GB  12.9GB               userdata

Here is what I’ve drafted..

#! /bin/bash
mkfifo Input
mkfifo Output
#Redirect commandline input from fifo to parted, Redirect output to fifo, background
cat Input &| - parted print >Output &
Line=""
while [ 1 ]
  do 
  while read Line
  do 
      if [ $Line == *Yes\/No\?* ]; then
        echo "yes">Input
      fi
      if [ $Line == *Fix\/Ignore/\Cancel\?* ]; then
        echo "fix">Input
      fi
      if [ $Line == *Fix\/Ignore\?* ]; then
        echo "fix">Input
      fi
      test $Line == *userdata* && break
  done<Output
  test $Line == *userdata* && break
done

But this does not work. If someone could assist me in redirecting output from a program into a fifo, then analyzing that data and directing output into another fifo to be put back in the original program? The desired results are in the first code block.

  • 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-31T00:38:15+00:00Added an answer on May 31, 2026 at 12:38 am

    If you always know what the needed inputs will be — if they never change from run to run — you can just redirect input from a file or from a HERE document and you don’t need to do anything complicated.

    If the needed inputs will change from run to run, you need to use something other than the shell because it will not make what you are trying to do possible. perl might be a good choice. (You don’t need to use expect here because you’re not trying to simulate a tty.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've managed to get a C# asp page running under ubuntu/apache/mono, but I don't
On my new Ubuntu system, I've managed to get Apache2 up and running for
I managed to get some help from a previous question and I have the
I managed to get custom themes running for Tabs but still got a lil
I've recently upgraded to emacs23 (Ubuntu 10.04) and I've managed to get my faces
I'm running the windows version of Tribler using wine in Ubuntu 10.10. Some times
Some time ago I managed to get RoR working on Windows XP. I've been
I'm trying to get smartgit running on Ubuntu, and I'm constantly getting this error:
I have recently managed to get Postfix smtp working on my Ubuntu server. The
Has anyone managed to get subsonic or a variant working on Windows Mobile? We

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.