Solved

Shell Scripting: Insert value from website into curl request

Posted on 2013-11-08
1
190 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

828 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