08-19-2012
As far as I can see, the script is intended to analyse the names of files found in a directory and produce a list of those files (prefixed by two comma-separated fields derived from the filename) in a file called temp.CSV in the same directory. This however does not tie up with the description in your previous post which implies some data edit.
Before you end up trashing every file in your directory with "trial-and-error" scripting, please post sample filenames and a full description of the process complete with matching sample output.
Also, please use code tags for code and data samples.
It is never necessary or desirable to end a line of a Bourne Shell script with a semi-colon (except for the one exception of certain syntax of the "find" command). This is unix script language not Oracle or Perl.
Last edited by methyl; 08-19-2012 at 02:45 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i have following statement in the script
echo -e "$str_XML_col_name:$str_field_type;" >> $i_DC_Key_$i_Tgt_DC_key_Schema
here $i_DC_Key is DC key and $i_Tgt_DC_key are the variables...............
when i ran the script i am getting error rec_merge.sh: $i_DC_Key_$i_Tgt_DC_key_Schema:... (1 Reply)
Discussion started by: mahabunta
1 Replies
2. Shell Programming and Scripting
Hi everyone, While I was trying to do
DATE=`date +"%Y%m%d_%H%M%S"`
STARTLOG=$TUXSTDDIR/start_$DATE.log
tmboot -y > $STARTLOG 2>&1
I got an error i.e. Ambiguous output redirect error. Here the first part is to boot the account so there is nothing wrong with that.... (6 Replies)
Discussion started by: pareshan
6 Replies
3. Shell Programming and Scripting
Hi Everyone,
# ll
total 0
-rw-r--r-- 1 root root 0 2010-05-13 11:29 a1.log
-rw-r--r-- 1 root root 0 2010-05-13 11:29 a2.log
-rw-r--r-- 1 root root 0 2010-05-13 11:29 a3.log
# rm a.log
above rm no problem, but when i use "> a.log", it says "-bash: a.log: ambiguous redirect".
... (3 Replies)
Discussion started by: jimmy_y
3 Replies
4. UNIX for Dummies Questions & Answers
I am trying to run the following script and I am getting an "ambiguous redirect" error. I have checked to make sure that the files are all where I have specified and are read/write as needed. Any ideas?
Note: I have removed the actual path info for privacy sake. I have triple checked to make... (1 Reply)
Discussion started by: malantha
1 Replies
5. Shell Programming and Scripting
Hello there,
I'm totally new in bash programming and ran into my first problem.
My script should generate 3 textfiles where the content of the first and the third row are the same in each file. Only the second row is different.
This is what I did in a very simplified explanation:
... (6 Replies)
Discussion started by: johndoe
6 Replies
6. Shell Programming and Scripting
This script has ambiguous redirect error.
...
cd $HOME
cd folder/work
# search all subfolders in work directory
find -mindepth 1 -maxdepth 1 -type d | while read directory
do
CUR_FOLDER="${directory#"./"}"
cd $CUR_FOLDER
chmod 644 *
for ff in *; do
if ; then
... (5 Replies)
Discussion started by: candyme
5 Replies
7. Shell Programming and Scripting
I came across the command string on https://www.unix.com/shell-programming-scripting/141885-awk-removing-data-before-after-pattern.html which was what I was looking for to be able to remove data before a certain pattern. However, outputting the result to a file seems to work on an individual basis... (4 Replies)
Discussion started by: HLee1981
4 Replies
8. Shell Programming and Scripting
Hello everybody,
I just took over this job from someone else and in the past this script they built worked but i recently upgraded from openSuSe 11.4 to 12.1
Now when i run the script i get an ambiguous error at line 25 (the first line after add() )
I have edited out the webpath and any... (1 Reply)
Discussion started by: gumbicus
1 Replies
9. Shell Programming and Scripting
Hi all,
I've been working on a bash script to help with backups that I have to do at work.
One of the lines in the script is supposed to launch an xterm, log into a specific server node and launch a tar backup to tape. This part works ok, but I've been trying to get stdout and stderr to... (2 Replies)
Discussion started by: Exitalterego
2 Replies
10. Shell Programming and Scripting
New to the site, please let me know I'm not meeting the post guidelines.
I'm creating a bash script to generate a report with output from a grep command. The goal is to direct
the output to a different log file by using a 'logger file'. But I get this error during the run: $1: ambiguous... (5 Replies)
Discussion started by: dallas88
5 Replies
LEARN ABOUT DEBIAN
bins_edit
BINS(1) General Commands Manual BINS(1)
NAME
bins_edit -- Set fields in XML picture description files for BINS
SYNOPSIS
bins_edit [-a | --album ] [-m | --html ] [-t title | --title title ] [-e event | --event event ] [-l location | --location loca-
tion ] [-p people | --people people ] [-y date | --date date ] [-d description | --description description ] [--longdesc longDe-
scription] [--shortdesc shortDescription] [--sample pictureFileName] [-g tag=value | --generic tag=value ] [-h | --help ] [-v |
--verbose ] [-q | --quiet ] [file] [files ...]
DESCRIPTION
This manual page documents briefly the bins_edit command.
This manual page was written for the Debian distribution because the original program does not have a manual page. Instead, it has docu-
mentation in HTML in /usr/share/doc/bins/index.html as well as a --help option.
bins_edit sets values in the XML picture description files that bins(1) uses to generate galleries.
OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included
below.
file By default, file is the filename of the XML file with the image properties. If the argument has no .xml suffix, it is added, so
you can directly give picture names on the command line. Spaces and other special characters (even newlines) can be used in val-
ues given as parameters as long as they are enclosed between quotes.
If the --album option is given, the filename refers to the directory of images, and the album.xml in that directory will be modi-
fied instead.
-a
--album edit album description (instead of the default of editing the image description.) In this case, the file parameter must be the
source directory of the album. Only the --title, --longdesc, --shortdesc and --sample switches make sense
with this option.
-m
--html input value will be interpreted as HTML code, thus, no HTML encoding or quoting will be done.
-t title
--title title
Set the title (of an image.)
-e event
--event event
Set the event name (of an album or image.)
-l location
--location location
Set the location (of an image.)
-p people
--people people
Set the list of people (of an image.)
-y date
--date date
Set the date (of an image.)
-d description
--description description
Set the description (of an image.)
--longdesc longDescription
Set the long description (of an album.)
--shortdesc shortDescription
Set the short description (of an album.)
--sample pictureFileName
Select the sample picture, within this album, to be used on the album list (template subalbum.html.) Note that the filename is
relative to the album directory, and thus doesn't have a directory component.
-g tag=value
--generic tag=value
This lets you set arbitrary fields in the relevant XML file (of the image or the album.) Generic tags appear inside description
which appears inside image; the tag appears as the name attribute of a field element, and the value appears as the content
of the element.
-h
--help Gives quick help (which this man page is based on.)
-v
--verbose This switch can appear several times to increase verbosity level.
-q
--quiet Suppress output.
EXAMPLES
Set the title of the Image.jpg file to "My picture":
bins_edit -t "My picture" Image.jpg
Set the title and location of all JPEG pictures in the directory:
bins_edit --title Holiday --location Paris *.jpg
Use of HTML values:
bins_edit --html --description '<b>BINS</b> is cool' file.jpg
Set the title short description and sample image of the album in the current directory (note the dot as final parameter):
bins_edit -a -t "My Album" --sample image.jpg --shortdesc "This is my album" .
SEE ALSO
bins (1).
AUTHOR
This manual page was written by Mark W. Eichin eichin@thok.org for the Debian system (but may be used by others). As it is mostly derived
from the bins_edit program itself, it is covered by the GNU General Public License.
BINS(1)