why is this cp script not working properly?, help needed, pls!!
Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
why is this cp script not working properly?, help needed, pls!!
Hi all,
I am trying to include a percentage bar with the cp command...
basically i am copying a few files onto ram during the boot process itself...
these files come upto 550mb and it evidently takes up some time for the cp to happen....
I have written a script that calculates the % of completion but the problem is that am unable to see the numericals when the cp is underway..
All i can see is the % mark that keeps moving...
But here is the surprising thing...If i use the same script to cp files once the system is up and running, i can see the numericals as well...
I am not sure why this is happening and need your help in figuring it out!!
The doubt i had was where the bc was capable of running at boot time?
So i included the binaries of bc into the ramdisk....but even then thre is no change??
Could you pls help me out with this?
NOTE:remember that this function is included in the one of the scripts that is required to mount FS onto respective place.....its not used after the system is up and running!!!!
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Not directly answering to you question but there is a flaw in your script. If cp hasn't complete in less than one second, you start a new cp from the beginning while the older one is still running. The cp command should be placed outside the while loop.
Hi there is a big flaw in the script as i found out.....
all the while i had been testing with some big files by transferring it from one point to another within the HD, so i it was pretty fast and the %shown was within a single line...
To test from the cd itself, i ran this script and passed arg,to cp frm the cd to HD and have a look at what i got...
This is neither professional nor is it good looking
may i know how i can have it at a single point ,like the way it generally happens with other cp.....
do i need to have a for loop?
I meant,
the code that i have already posted, gave me the %status like the one ive shown...
this means,in the boot screen this many lines are displayed,which is aesthetically not right!!!
I wanted to know how i can display from 1-100% on a single spot,thats all...
I mean instead of those lines, how do i get 1% then 2% instead of 1 (as the cp progresses)so on upto 100...which would look nice!!
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
I wasn't asking that much about what differs in the output which is obvious but really what differs in the way you launch the script. You do not tell how and where you run it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.