Solved

Shell Scripting: Insert value from website into curl request

Posted on 2013-11-08
1
191 Views
Last Modified: 2013-11-08
Using Linux and Shell Scripting, I want a list of all files along with their mime types.

I get the mime type like this:
file -i filename.txt

Open in new window


This does NOT work:
for f in *; \
do mime=file -i $f; echo "File: $f - Mime: $mime"; \
done

Open in new window

0
Comment
Question by:hankknight
1 Comment
 
LVL 14

Accepted Solution

by:
ThomasMcA2 earned 500 total points
ID: 39633312
Try this:

for f in *; 
do mime=`file -i $f`; echo "File: $f - Mime: $mime"; 
done

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question