help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] newbei Q


From: Seth David Schoen
Subject: Re: [Help-bash] newbei Q
Date: Thu, 24 Mar 2016 17:22:41 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

Val Krem writes:

> My question 
> 
> 1. I want use the unzip command to unzip files that are in the folder1
> and to put the unzipped files in folder1
> 
> unzip $f1/'*.zip' . However, I found the unzip files in the current 
> folder(where I am running the script). How can I correct this one.

The general way would be to cd (or pushd) "$f1" before running unzip.

The unzip command also has a -d argument which lets you specify a
directory where the output should go.

> 2. I have one executable FORTRAN (hashE) program and need the input file and 
> the input file is in other folder 
> 
> 
> cd $f3
>     hashE $f1/$var1_filename.csv 
> 
> 
> the error message is
> 
> /test/data/folder1/.csv: No such file or directory
> 
> How do I correct this one?

bash thinks that the variable name is var1_filename, not var1,
because an underscore is allowed to be part of a variable name in bash.
You can instead refer to "${var1}_filename.csv".

-- 
Seth David Schoen <address@hidden>      |  No haiku patents
     http://www.loyalty.org/~schoen/        |  means I've no incentive to
  8F08B027A5DB06ECF993B4660FD4F0CD2B11D2F9  |        -- Don Marti



reply via email to

[Prev in Thread] Current Thread [Next in Thread]