Sponsored Content
Top Forums Shell Programming and Scripting Echo displays strange output when '?' is used Post 303046018 by bedtime on Tuesday 21st of April 2020 05:37:32 PM
Old 04-21-2020
Quote:
Originally Posted by RudiC
I bet you have a P , a T , and a V file in your working directory, as ? is a "special pattern character" that "matches any single character" (cf man bash).
I do, yes. I have all those directories.


At least I know where it's coming from now. Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Strange output from grep

Hi, I am getting different output for grep depending which directory I am in. The following is a transcript of my session, I am using egrep but have also used grep -E. The directory names have been changed for security: $pwd /dir1/dir2/dir3/dir4 $echo 000000 |egrep -v $echo $? 1 $cd ..... (10 Replies)
Discussion started by: Bab00shka
10 Replies

2. AIX

who -r displays no output

Hello. I have an AIX machine at 6100-00. We had some strange activity since filling up /tmp. One symptom is that who -r displays no output. It doesn't hang just no output is displayed. We are going to boot the machine, but prior to that I'd like to dig a bit to see what may be causing the... (0 Replies)
Discussion started by: maficdan
0 Replies

3. UNIX for Dummies Questions & Answers

Creating a file that contains output from a command, and then displays itself

hey, I'm trying to create the command that will create a file named user.txt that contains the output of the command cut -d: -f1,5 /etc/passwd, and displays itself afterwards. I don't know how to bridge cat > user.txt with cut -d: -f1,5 /etc/passwd, or how display it afterwards. Any help would... (2 Replies)
Discussion started by: raidkridley
2 Replies

4. Shell Programming and Scripting

strange output

I had a similar script in solaris and it had no problem. I wrote this one in freeBSD and it gave me strange output. Can anyone please tell me why? thanks a lot #!/bin/sh #This is a shell script that checks file system capacity mounted on /home directory #If file system is over 90% capacity,... (1 Reply)
Discussion started by: k2k
1 Replies

5. Solaris

solaris 10 strange df output

hi, in solaris 10 SUN SPARC V245 server the following df -h output is showing . can i reuse the following disk space by deleting them /platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1 20G 5.2G 14G 27% /platform/sun4u-us3/lib/libc_psr.so.1... (2 Replies)
Discussion started by: phani.madiraju
2 Replies

6. Solaris

ls -l displays output with an error

when i use ls command it works normal but when i using additional parameter with ls like ls -l , ls -a... it shows a error followed by the output. # ls -l ./hgfs: Operation not applicable total 12861 -rw-r--r-- 1 root root 0 Jun 1 21:12 1 drwxr-xr-x 2 root root ... (4 Replies)
Discussion started by: chidori
4 Replies

7. UNIX for Advanced & Expert Users

strange output with du

Can someone please explain why I get two outputs with the du command? The first one gave me one. I also didn't ask for the second directory so why did it give that directory? $ du -h "/media/Part 1/Desktop/playlist" 775M /media/Part 1/Desktop/playlist $ du -h "/media/Part... (1 Reply)
Discussion started by: cokedude
1 Replies

8. UNIX for Advanced & Expert Users

Strange /etc/passwd output

Can someone please explain this to me? auser:x:500:500:Anne User:/home/auser:/bin/sh buser:x:501:501:Bob User:/home/buser:/bin/bash I'm used to it looking like this. What is the difference between the first name and second name? In the first case I had to use the first name to change my... (3 Replies)
Discussion started by: cokedude
3 Replies

9. Shell Programming and Scripting

Echo's strange output

Hi, Kindly help me to understand the behavior or logic of the below shell command $ echo $!# echo $echo $ $ $ echo !$# echo $# 0 I am using GNU bash, version 3.2.25(1)-release (2 Replies)
Discussion started by: royalibrahim
2 Replies

10. Shell Programming and Scripting

Script Output Displays Multiple Text

Hello there, I'm using a read-while loop to preserve the word Failed within a text file. For example, if the word Failed exist twice in a single text file, my STDOUT should re-direct to a new text file and display Failed twice. My output is attached to this thread. I would like output to... (4 Replies)
Discussion started by: SysAdminRialto
4 Replies
MATCH(1L)						      Schily's USER COMMANDS							 MATCH(1L)

NAME
match - searches for patterns in files SYNOPSIS
match [ -option ] pattern [ file ... ] DESCRIPTION
Match searches the named files or standard input (if no filenames are given) for the occurrences of the given pattern on each line. The program accepts literal characters or special pattern matching characters. All lines that match the pattern are output on standard output. You can only specify one pattern string for each match, however, you can construct an arbitrarily complex string. When you do not specify a file, match can be used as a filter to display desired lines. Standard in is used if no files are specified. OPTIONS
-not, -v Prints all lines that do not match. -i Ignore the case of letters -m Force not to use the magic mode -w Search for pattern as a word -x Display only those lines which match exactly -c Display matching count for each file -l Display name of each file which matches -s Be silent indicate match in exit code -h Do not display filenames -n Precede matching lines with line number (with respect to the input file) -b Precede matching lines with block number REGULAR EXPRESSIONS
The following is a table of all the pattern matching characters: c An ordinary character (not one of the special characters discussed below) is a one character regular expression that matches that character. c A backslash () followed by any special character is a one character regular expression that matches the special character itself. The special characters are: ! # % * { } [ ] ? ^ $ ! Logical OR as in match this!that!the_other. You may have to use `{}' for precedence grouping. # A hash mark followed by any regular expression matches any number (including zero) occurrences of the regular expression. ? Matches exactly any one character. W? matches Wa, Wb, Wc, W1, W2, W3 ... * Matches any number of any character. % Matches exactly nothing. It can be used in groups of ored patterns to specify that an empty alternative is possible. {} Curly brackets may be used to enclose patterns to specify a precedence grouping, and may be nested. {%!{test}}version matches the strings testversion and version. [string] A non empty string of characters enclosed in square brackets is a one character regular expression that matches any one character in that string. If however the first character of the string is a circumflex (^), the one character expression matches any character which is not in the string. The ^ has this special meaning only if it occurs first in the string. The minus (-) may be used to indi- cate a range of consecutive ASCII characters; for example, [0-9] is equivalent to any one of the digits. The - loses it's special meaning if it occurs first (after an initial ^, if any) or last in the string. The right square bracket (]) and the backslash () must be quoted with a backslash if you want to use it within the string. ^ Matches the beginning of a line. $ Matches the end of a line. (^*$ matches any entire line) EXAMPLES
FILES
None. SEE ALSO
grep(1), fgrep(1), egrep(1) DIAGNOSTICS
NOTES
Even if a match occurs more than once per line, the line is output only once. Quote special pattern matching characters to prevent them from being expanded by the Command Interpreter. BUGS
The length of the pattern is currently limited to 100 characters. This limit is reduced by 38 if the -w option is used. Joerg Schilling 15. Juli 1988 MATCH(1L)
All times are GMT -4. The time now is 09:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy