Sponsored Content
Top Forums UNIX for Advanced & Expert Users find iname is being case sensitive Post 302546560 by alister on Thursday 11th of August 2011 11:58:06 AM
Old 08-11-2011
Quote:
Originally Posted by COKEDUDE
Does shell expansion get handled differently in find with double quotes and single quotes than other programs? I know in grep shell expansion still happens with double quotes and not with with single quotes. I learned that from fpmurphy.
You need to understand that the shell's behavior is invariant with regard to what utilities you intend to invoke. The shell does not care one bit if you are trying to use find, or grep, or ls, or... The shell's job is basically to read a line of text, process that text according to its rules (expansions, substitutions, redirections, et al), and create a process running the desired utility with the requested arguments.

The invoked utility does not know or care if it was created by a command interpreting shell. It simply processes the arguments it was passed and gets to work.

Not knowing where the shell ends and a utility it invokes begins is a huge impediment to understanding what's going on. If this line is not clear to you, in my opinion, the most beneficial thing you could do in the very near future is to spend a few hours with the command parsing section of your shell man page, until you understand it thoroughly. It will serve you very, very well. Once you get it, you can look at the most complicated stuff and work your way through it.

You'll learn the order in which the shell performs substitutions and expansions. It'll also become trivial to understand the effects of quoting. In short, any text enclosed by single quotes (aka strong quotes) is taken literally. Nothing special happens. Double quotes (aka weak quotes) bypasses only those shell expansions, substitutions, and parsing steps that could increase the number of fields (this includes field splitting on IFS characters and filename expansion). So, no matter how the text within the double quotes is modified by processing, in the end you'll always have a single field (this is why double quoted command substitutions in a for loop list are utterly pointless).

Note: There is one exception to the double quote rule: "$@" expands to multiple fields, one per positional parameter (a hack workaround to allow dealing with a list of items when there was no list type).

Also, it may help to understand the basics of the system's execve(2) system call, which is responsible for loading a new executable image, which includes passing the command line arguments and the environment.

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix user ID's case-sensitive?

It has been quite a while since I used UNIX. I am developing a security system and I was wondering if UNIX and/or LINUX user ID's are case-sensitive. i.e. can user 'daveb' and 'Daveb' exist on the same system with completely different authorizations/priorities, etc.? (3 Replies)
Discussion started by: dmilleville
3 Replies

2. UNIX for Dummies Questions & Answers

find with -iname

Hi, In some versions of UNIX find works with -iname so that you can find files regardles of the case. In Solaris this is not working - Anys suggestions? Also, how can I list directory names only using find? Thanks. (2 Replies)
Discussion started by: GMMike
2 Replies

3. UNIX for Dummies Questions & Answers

Is Hostname Case sensitive ?????

Hello users, I have a question ? I was just wondering whether the hostname on unix systems are case sensitive. For example in the system which I work. ping TestHost and ping testhost gives me the same output i.e I get the reply from the remote host Is this applicable for all... (3 Replies)
Discussion started by: ajphaj
3 Replies

4. UNIX for Dummies Questions & Answers

how to disable case sensitive on RHEL ?

Hi all, Im newbie, can i disable case sensitive on RHEL environment, and how? Thank you. (2 Replies)
Discussion started by: blesets
2 Replies

5. Shell Programming and Scripting

Ignore case sensitive in Case Switch

In a Case switch, how to ignore case sensitive in the test: e.g. case "$field" in "TEST) action1;; *) action2;; esac How to go in action1 in case of $field = TEST , or Test , or test or .... without enumerating all possibilities... Thanks,... (1 Reply)
Discussion started by: annelisa
1 Replies

6. Solaris

Tcp_conn_req_max_q (CASE-sensitive?)

I was instructed by my superior to change kernel parameter, adding up this parameter to /etc/system. Server is Solaris 10 on SPARC. Tcp_conn_req_max_q 1024In my Google search, all I know that the sentence is in small case (tcp_conn_req_max_q) but as you can see above, instruction given... (4 Replies)
Discussion started by: Olli.Lang
4 Replies

7. UNIX for Dummies Questions & Answers

How to take parameters as non case sensitive

Is there a way for me to take a parameter then store it in a variable and use its value as non case sensitive? Ex. Lets say i have a parameter which contains "Hey". Then im gonna store it to GR using GR=$1. CL=/install/$GR.g How can i make GR non case sensitive so that the... (1 Reply)
Discussion started by: khestoi
1 Replies

8. Shell Programming and Scripting

Case sensitive in If loop .

Hi All, select app from the menu: ABC DEF GHI JKL ALL # ALL will select all the apps in the menu echo "Enter your option" read option; if then <execute the below command> elif # option is the 1 selection from menu...not ALL <execute the below command> else (14 Replies)
Discussion started by: Devaraj A
14 Replies

9. Shell Programming and Scripting

Repeated lines-case sensitive

Hi, users file contains below names i have a requirement to keep only one case sensitive user. For e.g if user name is "aaa" then only aaa should be there in the file and other matching users(AAA,aaA) should be deleted. Tried multiple options but no luck can you please help. aaa abc AAA... (2 Replies)
Discussion started by: Satyak
2 Replies

10. Shell Programming and Scripting

Please help me in using case sensitive command

Hello All, Please help me with this I need to create a cronjob that should delete all files which are older than 30days with '*.txt' and should not delete files with '*TEST*.txt' either file name TEST is upper or test lower case sensitive here's the script /DIR -type f -name '*.txt'... (7 Replies)
Discussion started by: krish_007
7 Replies
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 12:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy