Sponsored Content
Full Discussion: To quote or not
Top Forums UNIX for Dummies Questions & Answers To quote or not Post 302844085 by g.j.huebschman on Friday 16th of August 2013 10:53:45 AM
Old 08-16-2013
To quote or not

My question is, "Do I not understand, or is my information out of date?"
I am trying to just be a student, rtfm'ing. I am working on my work systems. Is it simply that the book was printed in 2002 and a lot has changed since then, or did I miss something?

Working in Korn Shell.
I have been reading O'Reilly "Learning the Korn Shell." (Which deals with ksh93)
We have Version M-11/16/88f, not 93.

I was reading about quoting, and the book cited an example using the 'find' command. It states that I need to quote wildcards used in the find command. It also says I need to use "-print" to see the results.

I use the find command a lot. I have neither been quoting/escaping, nor using -print, but I get what I am looking for:
Code:
root@s0ms3rv3r:/ >find / -name *dsmerr*
/etc/dsmerror.log
/home/s0m3uz3r/.ssh/dsmerror.log
/home/s0m3uz3r/dsmerror.log
/home/s0m3uz3r/tsm/scripts/dsmerror.log
/sys/logs/tsm/dsmerror.log
/usr/local/adm/clscripts/dsmerror.log
/usr/local/adm/hacmp/bak/dsmerror.log
/usr/local/adm/hacmp/dsmerror.log
/usr/local/adm/scripts/archive/dsmerror.log
/usr/local/adm/scripts/dsmerror.log
/usr/tivoli/tsm/client/ba/bin/dsmerror.log
/usr/tivoli/tsm/server/bin/dsmerror.log
root@s0ms3rv3r:/ >set -o emacs
root@s0ms3rv3r:/ >Version M-11/16/88f
root@s0ms3rv3r:/ >find / -name '*dsmerr*'
/etc/dsmerror.log
/home/s0m3uz3r/.ssh/dsmerror.log
/home/s0m3uz3r/dsmerror.log
/home/s0m3uz3r/tsm/scripts/dsmerror.log
/sys/logs/tsm/dsmerror.log
/usr/local/adm/clscripts/dsmerror.log
/usr/local/adm/hacmp/bak/dsmerror.log
/usr/local/adm/hacmp/dsmerror.log
/usr/local/adm/scripts/archive/dsmerror.log
/usr/local/adm/scripts/dsmerror.log
/usr/tivoli/tsm/client/ba/bin/dsmerror.log
/usr/tivoli/tsm/server/bin/dsmerror.log
root@s0ms3rv3r:/ >
 
 
root@4nothrs3rv3r:/ >ls -ltr $(find / -name *dsmerr*)
-rwxrwx--- 1 root system 1450 Apr 28 2003 /usr/local/adm/clscripts/dsmerror.log
-rw-r----- 1 root system 1068 Jan 25 2007 /usr/local/adm/scripts/archive/dsmerror.log
-rw-r--r-- 1 root system 161 Apr 22 2010 /usr/lpp/tivoli.tsm.client.hsm.jfs2/dsmerror.log
-rw------- 1 root system 24112 Aug 14 13:17 /sys/logs/tsm/dsmerror.log
-rw-r--r-- 1 oracle dba 578 Aug 14 13:34 /sys/logs/tsm/orasched-dsmerr.log
root@4nothrs3rv3r:/ >ls -ltr $(find / -name '*dsmerr*')
-rwxrwx--- 1 root system 1450 Apr 28 2003 /usr/local/adm/clscripts/dsmerror.log
-rw-r----- 1 root system 1068 Jan 25 2007 /usr/local/adm/scripts/archive/dsmerror.log
-rw-r--r-- 1 root system 161 Apr 22 2010 /usr/lpp/tivoli.tsm.client.hsm.jfs2/dsmerror.log
-rw------- 1 root system 24112 Aug 14 13:17 /sys/logs/tsm/dsmerror.log
-rw-r--r-- 1 oracle dba 578 Aug 14 13:34 /sys/logs/tsm/orasched-dsmerr.log

I am not being deliberately thick. I am inclined to assume, "old book, old shell, it works how it works, move on..."
But, I have hamstrung myself in the past by carrying around half-misunderstood concepts. Quoting and regex are things that are fuzzy to me, and I want to get them straight.

Last edited by Scott; 08-16-2013 at 11:56 AM.. Reason: Please use code tags
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capturing Data between first quote and next quote

I have input file like RDBMS FALIURE UTY8703 'USER_WORK.TEST' .HIghest return code '12' I want to parse data which comed between first quote till next quote USER_WORK.TEST can you please suggest how to do that (4 Replies)
Discussion started by: scorp_rahul23
4 Replies

2. Shell Programming and Scripting

double-quote inside double-quote

hey all, i made a simple .sh like this: echo "<style media="screen" type="text/css">@import url("main.css");</style>" but the output is: <style media=screen type=text/css>@import url(main.css);</style> i want to keep double-quotes, can anyone help me? thanks (3 Replies)
Discussion started by: indraf
3 Replies

3. Shell Programming and Scripting

Quote and variable

The command line bellow works fine by itself. /opt/csw/bin/rsync -azq --delete -e "ssh -i /.ssh/ss" /home/ me@myaccount.storage.com:/home/ Now I would like to introduce some variable into it and make a .sh file such as bellow and it does not work anymore. I guess the part -e "ssh -i /.ssh/ss" has... (4 Replies)
Discussion started by: ngungo
4 Replies

4. Shell Programming and Scripting

Regex in grep to match all lines ending with a double quote (") OR a single quote (')

Hi, I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file: Name = "abc" The regex I'm using to match the same is: egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies

5. Shell Programming and Scripting

replacing a quote in some lines with multiple quote fields

i want to replace mistaken quotes in line starting with tag 300 and relocate the quote in the correct position so the input is 223;25 224;20100428064823;1;0;0;0;0;0;0;0;8;1;3;9697;18744;;;;;;;;;;;; 300;X;Event:... (3 Replies)
Discussion started by: wradwan
3 Replies

6. Shell Programming and Scripting

getting value between double quote

Can somebody supply me with a simple way to get a value between two double quotes? Example: input = ADR base is "/u01/app/oracle" output = /u01/app/oracle Thanks to all who answer (4 Replies)
Discussion started by: BeefStu
4 Replies

7. Shell Programming and Scripting

Replacing Double Quote in Double Quote incsv file

Hi All , We have source data file as csv file and since data could contain commas ,each attribute is quoted into double quotes.However problem is that some of the attributa data also contain double quotes which is converted to double double quote while creating csv file XLs data : ... (2 Replies)
Discussion started by: Shalini Badal
2 Replies

8. Shell Programming and Scripting

Replacing all but the first and last double quote in a line with a single quote with awk

From: 1,2,3,4,5,This is a test 6,7,8,9,0,"This, is a test" 1,9,2,8,3,"This is a ""test""" 4,7,3,1,8,"""" To: 1,2,3,4,5,This is a test 6,7,8,9,0,"This; is a test" 1,9,2,8,3,"This is a ''test''" 4,7,3,1,8,"''"Is there an easy syntax I'm overlooking? There will always be an odd number... (5 Replies)
Discussion started by: Michael Stora
5 Replies

9. What is on Your Mind?

A terrific quote:

Food for thought! """ Everybody in this country should learn to program a computer...because it teaches you how to think. """ Steve Jobs. So, SO, true! Merry XMAS all... (4 Replies)
Discussion started by: wisecracker
4 Replies
AMC-EXPORT(1)						       Auto Multiple Choice						     AMC-EXPORT(1)

NAME
AMC-export - exports marks for AMC multiple choice exams. SYNOPSIS
auto-multiple-choice export --data project-data-dir --module module --fich-noms students-list.csv [--noms-encodage list-encoding] --o output-file DESCRIPTION
The AMC-export.pl command exports marks from an Auto Multiple Choice exam. --data project-data-dir gives the directory where data files are (see for example AMC-prepare(1)). --module module selects a module for export. See below for the modules included in the AMC standard distribution. --fich-noms students-list.csv sets the students list file. --noms-encodage list-encoding selects an encoding for file students-list.csv (default is utf-8). --o output-file gives the output file name. --option-out options gives an option for selected module, in the form key=value (see below for possible options for each module). To specify multiple options, use --option several times. --sort sort-type sort the students names, depending on sort-type. If sort-type is l, use line number from students list file to sort. If sort-type is m, use mark (and name if marks are equal) to sort. If sort-type is i, use student number to sort. If sort-type is n, use name to sort (or line from students list if equal). --useall all if all is 0 or empty, only students with a scaned answer sheet appears in the output. If all is 1, all students in the students list appears in the output. MODULES
OpenDocument With "--module ods", an OpenDocument (for use by OpenOffice or LibreOffice for example) is produced. The following options are recognized: nom gives a name for the exam, to be written on the beginning of the sheet. code gives an short name for the exam, to be used as a tab name. columns sets the list of columns that are to be added to each student. Default value is student.key,student.name. stats with a true value, a table will be added with statistics for all questions. statsindic with a true value, a table will be added with statistics for all indicative questions. CSV With "--module CSV", a CSV file is produced. The following options are recognized: columns sets the list of columns that are to be added to each student. Default value is student.copy,student.key,student.name. decimal sets the decimal point (default is a dot). encodage sets the encoding to use for output (default is utf-8). separateur sets the character used between colums (default is a comma). entoure sets the character used to enclose strings (default is a double quote). ticked if not empty, additional columns (with "CHECKED:" prefix) are included to give all the checked boxes on all the sheets. This can be used by an external program to retrieve all the checked boxes when marks are not sufficient. Use value 01 to get 0;0;1;1;0 if boxes 3 and 4 are checked, and value AB to get CD if boxes 3 and 4 are checked. List With "--module List", a PDF file is produced with a list of marks for all students. The following options are recognized: pagesize The page size. Default value is a4. nom gives the name of the exam, to be printed at the top of the page. ncols The number of columns. Default value is 2. decimal sets the decimal point (default is a dot). AUTHORS
Alexis Bienvenue <paamc@passoire.fr> Main author Jean Berard Translation from French Georges Khaznadar Translation from French COPYRIGHT
Copyright (C) 2008-2012 Alexis Bienvenue This document can be used according to the terms of the GNU General Public License, version 2 or later. Auto Multiple Choice 1.1.1 06/19/2012 AMC-EXPORT(1)
All times are GMT -4. The time now is 04:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy