Sponsored Content
Full Discussion: String comparison
Top Forums Shell Programming and Scripting String comparison Post 302941672 by sea on Sunday 19th of April 2015 02:46:46 PM
Old 04-19-2015
In addition to what RudiC said, variables which contain spaces or special chars should be within quotes.
 

10 More Discussions You Might Find Interesting

1. Programming

String Comparison

Hi all, I have a file like this ibhib=ere wefwfl=werfe sfdes=wef From this file, i need to get the lefthand side string with respect to the corresponding righthand side string. i.e, I need to get the string "ere" with respect to "ibhib". But i am stuck with how to compare a string... (1 Reply)
Discussion started by: abey
1 Replies

2. Shell Programming and Scripting

string comparison

The script will read a bunch of names, and test if it contains "John", but as below apparently ~ does not work, so what is the easiest way to perform string comparison in bash shell script? thanks ... elif then echo "get John" .... (2 Replies)
Discussion started by: fedora
2 Replies

3. Shell Programming and Scripting

string comparison

Hello experts, (tcsh shell) Quite new to shell scripting... I have got a file with a single word on each line. Want to be able to make a comparison such that i can read pairs of words that are ROT13 to each other. Also, i would like to print the pairs to another file. Any help... (5 Replies)
Discussion started by: Jatsui
5 Replies

4. UNIX for Dummies Questions & Answers

string comparison

Hi Guys i need to write a script to check the file structure I have added the the file headers in the configuration file and execute the file at the start of the script. Now the function checkFileStructure() { echo "Inside the function" filetocheck=$1 fileheader=$2 if ] then... (1 Reply)
Discussion started by: Swapna173
1 Replies

5. Shell Programming and Scripting

Help with String Comparison

I'm running the following script to compare string values to a regexp: for entry in $(lpinfo -v | cut -c 1-); do if then echo "blah" continue fi done Whenever I run it, each token of lpinfo is being interpreted as a command and I get errors such as: ... (2 Replies)
Discussion started by: hypnotic_meat
2 Replies

6. UNIX and Linux Applications

Need Help on String Comparison

Hi , My requirement is to read from a file into a variable. I need to check if the variable is equal to string "no rows selected". The sh script snippet is as follows: file=/data/lpgtwo/home/nikhilp/TriggerNames.txt echo $file var=`cat $file` echo $var if then echo "No... (3 Replies)
Discussion started by: MNG
3 Replies

7. Shell Programming and Scripting

Help with string comparison

#!/bin/sh PRINTF=/usr/bin/printf MACHINE_NAME=`uname -n` TIME=`date +"%H"` $PRINTF "Welcome to $MACHINE_NAME. What is your name?\n" read NAME if ; then $PRINTF "Good morning $NAME, how are you?\n" elif ; then $PRINTF "Good afternoon $NAME, how are you?\n" else $PRINTF "Good... (2 Replies)
Discussion started by: ikeQ
2 Replies

8. Shell Programming and Scripting

to extract string from main string and string comparison

continuing from my previous post, whose link is given below as a reference https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 consider there is create table commands in a file for eg: CREATE TABLE `Blahblahblah` ( `id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies

9. Homework & Coursework Questions

passing letters from an array into a string for string comparison

attempting the hangman program. This was an optional assignment from the professor. I have completed the logical coding, debugging now. ##I have an array $wordString that initializes to a string of dashes ##reflecting the number of letters in $theWord ##every time the user enters a (valid)... (5 Replies)
Discussion started by: lotsofideas
5 Replies

10. Shell Programming and Scripting

awk string comparison unterminated quoted string andrule of thumb

I have the logic below to look up for matches within the columns between the two files with awk. In the if statement is where the string comparison is attempted with == The issue seems to be with the operands, as 1. when " '${SECTOR}' " -- double quote followed by single quote -- awk matches... (1 Reply)
Discussion started by: deadyetagain
1 Replies
clamz(1)						      General Commands Manual							  clamz(1)

NAME
clamz - download MP3 music files from Amazon.com SYNOPSIS
clamz [ options ] amz-file ... DESCRIPTION
clamz is a little command-line program to download MP3 files from Amazon.com's music store. It is intended to serve as a substitute for Amazon's official MP3 Downloader, which is not free software (and therefore is only available in binary form for a limited set of plat- forms.) clamz can be used to download either individual songs or complete albums that you have purchased from Amazon. In order to use clamz, you must first enable the ``MP3 dowloader mode'' by visiting the following URL: http://www.amazon.com/gp/dmusic/after_download_manager_install.html?AMDVersion=1.0.9 If you are outside the US, replace `amazon.com' with the corresponding domain for your country (e.g., amazon.co.uk for the UK, or amazon.fr for France.) Amazon does not allow anyone to purchase MP3 files from outside their country of residence. To download the contents of an AMZ file into the current directory, just run clamz some-file-name.amz More advanced options are listed below. OPTIONS -o name-format, --output=name-format Set the name of the downloaded file(s). This may contain any of several variables which are derived from the input AMZ file; see FORMAT VARIABLES below. Note that the format string should be enclosed in single quotes, to stop the shell from expanding variables itself. -d directory-format, --output-dir=directory-format Set the directory where the downloaded files should be placed. (If this directory does not exist, it will be created.) This may also contain format variables. -r, --resume Resume downloading a partially-downloaded album. (By default, if you are downloading a file named foo.mp3, and the file foo.mp3 already exists in the destination directory, clamz will rename the new file to foo.mp3.1 to avoid overwriting the old file. If the -r option is used, clamz will instead assume that the first part of the file has already been downloaded, and will resume download- ing from where it left off.) -i, --info Rather than downloading anything, just display detailed information about the given AMZ file(s) to standard output. -x, --xml Rather than downloading anything, print the raw, decrypted XML data from the AMZ file to standard output. -v, --verbose Display detailed information while downloading. -q, --quiet Turn off the normal progress display; display only error messages. --forbid-chars=characters Do not allow the given characters to be used in output filenames. Note that control characters and slashes may never be used in filenames. --allow-chars=characters Opposite of the above; remove the given characters from the set of disallowed characters. --allow-uppercase Allow uppercase letters in filenames. --forbid-uppercase Do not allow uppercase letters in filenames. --utf8-filenames Use UTF-8 when writing filenames (the default behavior is to use UTF-8 if the system locale says so, otherwise ASCII.) --ascii-filenames Use only ASCII characters in filenames. --help Print out a summary of options. --version Print out version information. FORMAT VARIABLES As part of a name-format or directory-format option, you may include references to environment variables (e.g., $HOME) or to the `xdg-user- dirs' configuration variables (e.g., $XDG_MUSIC_DIR or $XDG_DESKTOP_DIR.) In addition, the following special variables are defined for each track, based on the information provided in the AMZ file, and subject to the above configuration options (--forbid-chars, --forbid-uppercase, etc.) ${title}, ${creator}, ${tracknum}, ${discnum}, ${genre}, ${asin} Title, creator, track number, disc number, genre, and ASIN (Amazon Standard Identification Number) of each individual track. ${album}, ${album_artist}, ${album_asin} Title, primary artist, and ASIN of the album the track comes from. (This information is available both for single-track and full- album downloads.) ${suffix} Suffix of the output file (currently only `mp3'.) ${amz_title}, ${amz_creator}, ${amz_genre}, ${amz_asin} These variables formerly contained metadata for the AMZ file as a whole; current AMZ files do not contain this information. Using these variables is not recommended. Similar to shell variable expansion, you can also use the following conditional expressions: ${var:-string} Expands to the value of variable var if it is defined and non-empty; otherwise, expands to string (which may itself contain variable references.) ${var:+string} Expands to string if the variable var is defined and non-empty; otherwise, expands to an empty string. Note that when you include format variables in a command-line argument, you will usually need to enclose the argument in single quotes ('...'), or insert a backslash before the `$', to prevent the shell from trying to expand the variables itself. FILES
$HOME/.clamz/config General configuration file, providing default settings for the --output, --forbid-chars, --allow-uppercase and --utf8-filenames options. $HOME/.clamz/amzfiles/ Directory containing backup copies of AMZ files. $HOME/.clamz/logs/ Directory containing log files. ENVIRONMENT
http_proxy HTTP proxy to use for downloading files; use `server:port' to specify a port number. AUTHOR
Benjamin Moody <floppusmaximus@users.sf.net> Clamz 0.5 October 2011 clamz(1)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy