Sponsored Content
Full Discussion: Too simple to search for
Top Forums UNIX for Dummies Questions & Answers Too simple to search for Post 302093636 by spudtheimpaler on Saturday 21st of October 2006 09:55:46 AM
Old 10-21-2006
Too simple to search for

Hey. I'm just getting started with scripting and although i will admit i haven't searched the forum yet, i think it would be a waste of time. It really will be very simple.

I want to enter a list of arguments after my script with the last being the filename. (not the first, as this is part of the requirements)

I so far have

Code:
var=$#
filename=$var
echo "last argument is $filename"

Now i have put every variation i can think of around the second lines var in order the change the value of filename to be from the location in the list of arguments to the argument itself, ie if i put

sh script hi there smelly

smelly is the last argument.

i want the filename to take on the value of the file smelly, not the value 3 (3rd argument)

if i put sh script hi there scriptfile1
where scriptfile1 exists and is the file i want to to point to, it still has argument 3. Whilst I would rather have it point to a file that already exists, i don't mind if it creates a new tempfile, (and will do checks on if files exist once i can get this sorted) i would just like to know how i can have it point to a filename rather than the argument number.

I'm sure i've made that a lot more difficult that it is, but any advice would be appreciated.

Regards, and thanks for your time!

Mitch.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Simple? Search replace

in vi, if i type ctrl-J, i can shift the next line up to the current line. I need to do this whenever a specific string exists (in particular ^M) ,however i have not been able to find a way to do this in vi, sed, or awk seems simple enough. can someone help me? thanks in advance (9 Replies)
Discussion started by: Brandt
9 Replies

2. Shell Programming and Scripting

Simple Search and Replace - Revisited

I have a ascii file with lines like this: 240|^M\ ^M\^M\ Old Port Marketing order recd $62,664.- to ship 6/22/99^M\ when this record gets loaded into my database, the \ is stored literally and so the user sees carriage return \ (hex 0D 5C) when what i need is carriage return line feed (hex 0D... (1 Reply)
Discussion started by: Brandt
1 Replies

3. UNIX for Dummies Questions & Answers

Simple search pattern help

Hi I need to define a pattern that will match an open square bracket, a series of numbers fro 1 to 4 digits in length and a close square bracket. Examples of the numbers I will need to find are: or or or I am using BBEdit to search, and BBEdit uses the standard GREP search... (1 Reply)
Discussion started by: alisamii
1 Replies

4. Shell Programming and Scripting

Simple (not for me) string search script

hi there, I am a complete newb to bash but am going to try and make a script to help me seach text files for strings of interest, any help that one of you gurus could pass on will be greatly received!! I want to write something like: in "text1.txt" find "string1" and copy out the line... (7 Replies)
Discussion started by: jumbo999
7 Replies

5. Shell Programming and Scripting

How to do a simple awk search?

Hello I am trying to do global search on access log files for a date and for either 'Error|error' string ls -lrt *access* | grep "Sep 23" | awk '{print $9}'|xargs awk '/23\/Sep\/2011/ && /Error/ || /error' Above matches All lines with 'error' as well unfortunately. Is there a... (6 Replies)
Discussion started by: delphys
6 Replies

6. Shell Programming and Scripting

Simple awk search problem

Hello; we have : awk '/reg_exp/,0/ prints every line after the first occurrence of "reg_exp" But if I want to print rest of the lines AFTER the last occurrence of "reg_exp", how would I do it ?? Tried : awk ' ! (/reg_exp/,0)' But it errored... Thank you for any... (5 Replies)
Discussion started by: delphys
5 Replies

7. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

8. Red Hat

Syslog.conf: looking for a simple answer on a simple question

Cheers! In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not? To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies

9. UNIX for Dummies Questions & Answers

[Solved] Having trouble with simple grep search

I have a text file (allWords.txt), that I would like to search through. Here is a snippet of what it looks like... a aah aahed aahing aahs aardvark aardvarks aardwolf ab abaci aback abacus abacuses abaft ...... I would like to use the grep search to search, line by line, for... (8 Replies)
Discussion started by: blackvelvet
8 Replies
VAMP-SIMPLE-HOST(1)					      General Commands Manual					       VAMP-SIMPLE-HOST(1)

NAME
vamp-simple-host -- a simple Vamp plugin host SYNOPSIS
vamp-simple-host [-s] [pluginlibrary[.so]:plugin[:output]] [file] [-o outfile] vamp-simple-host [-s] [pluginlibrary[.so]:plugin] [file] [[outputno]] [-o outfile] DESCRIPTION
This manual page documents briefly the vamp-simple-host command. vamp-simple-host allows processing of a libsndfile-readable audio file using Vamp plugins, listing available plugins and the plugin search path. By default, vamp-simple-host loads plugin id plugin from pluginlibrary and runs it on the audio data in file, retrieving the named output, or output number outputno (the first output by default) and dumping it to standard output, or to outfile if the -o option is given. pluginlibrary should be a library name, not a file path; the standard Vamp library search path will be used to locate it. If a file path is supplied, the directory part(s) will be ignored. If the -s option is given, results will be labelled with the audio sample frame at which they occur. Otherwise, they will be labelled with time in seconds. OPTIONS
-l, --list List the plugin libraries and Vamp plugins in the library search path in a verbose human-readable format. --list-full List all data reported by all the Vamp plugins in the library search path in a very verbose human-readable format. --list-ids List the plugins in the search path in a terse machine-readable format, in the form vamp:soname:identifier. --list-outputs List the outputs for plugins in the search path in a machine-readable format, in the form vamp:soname:identifier:output. --list-by-category List the plugins as a plugin index by category, in a machine-readable format. The format may change in future releases. -p Print out the Vamp library search path. -s Label results with the audio sample frame at which they occur. Otherwise, they will be labelled with time in seconds. -o file Dump plugin output into file. -v Display version information only. ENVIRONMENT
VAMP_PATH A colon-separated list of directories to look for plugins. AUTHOR
This manual page was written by Szekelyi Szabolcs cc@mail.3d.hu for the Debian system (but may be used by others), because the original program does not have a manual page. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Gen- eral Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. VAMP-SIMPLE-HOST(1)
All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy