Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How to store lftp command result to a variable

Avatar of techbie
techbie asked on
Operating SystemsShell ScriptingLinux Distributions
5 Comments1 Solution3336 ViewsLast Modified:
Hi all -

I have an lftp program which perform a put operation and then check the size of the file.

put -O /home/ $FILE -o $FILE_NAME
du -b /home/$FILE_NAME

Now, I want to capture the output of the du command and make sure the size of the local file and size of the remote file matches.

The problem is, I am not how to capture this option to a variable so I can use it for my checking purpose.

I tried
x=du -b /home/$FILE_NAME , but it doesn't seem to work.

Any advice is highly appreciated.