![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Listing directories and sub directories | jinxor | UNIX for Advanced & Expert Users | 3 | 03-11-2008 10:27 AM |
| Wierd results with awk | amatheny | Shell Programming and Scripting | 2 | 11-01-2007 06:12 PM |
| moving directories to new directories on multiple servers | mackdaddy07 | Shell Programming and Scripting | 0 | 04-06-2007 12:30 PM |
| TOP Results AIX 5.3 | mcastill66 | AIX | 1 | 09-26-2005 01:54 PM |
| set -A RESULTS | Ashishm | Shell Programming and Scripting | 2 | 04-08-2002 01:26 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Different results from awk, sed, tr in different directories???
I cannot explain why it gives different results when I try the awk, sed, tr command combination with the same input.
(aondufd1)psoftfs:/aon/dev/psoft/FSTST88/autosys>echo ${MailFile} + echo mfint003pr.in1* mfint003pr.in1* (aondufd1)psoftfs:/aon/dev/psoft/FSTST88/autosys/scripts>echo ${MailFile} | awk -F. '{ print $1 "." }' | sed 's/.*\(...\)\..*/\1/' | tr [A-Z] [a-z] | tr -d [0-9] + echo mfint003pr.in1* + awk -F. { print $1 "." } + sed s/.*\(...\)\..*/\1/ + tr -d 1 + tr [A-Z] a 3pr (aondufd1)psoftfs:/aon/dev/psoft/FSTST88/autosys/scripts>cd ../parm + cd ../parm (aondufd1)psoftfs:/aon/dev/psoft/FSTST88/autosys/parm>echo ${MailFile} | awk -F. '{ print $1 "." }' | sed 's/.*\(...\)\..*/\1/' | tr [A-Z] [a-z] | tr -d [0-9] + echo mfint003pr.in1* + awk -F. { print $1 "." } + sed s/.*\(...\)\..*/\1/ + tr -d [0-9] + tr [A-Z] [a-z] pr One big question mark in my head right now. Could someone please help. Thanks. There were no additional profiles loaded when changing directories. just doing the cd command. The output should be 3pr. That would be the correct one, right? |
|
||||
|
that is genius! yup I have file named 1 in the first directory. Yes, that is our resolution, to put double quotes for "[0-9]" and to "[A-Z]" "[a-z]". Just a stupid question:
1. How does tr read the file named 1, but I know the tr only accepts strings and characters. I tried to create a file named 3, and it accepts the 1 and 3 files and went to syntax error. how does it happens? (aondufd1)acking:/aon/dev/psoft/FSTST88/autosys/parm>echo ${MailFile} | awk -F. '{ print $1 "." }' | sed 's/.*\(...\)\..*/> + echo mfint003pr.in1* + awk -F. { print $1 "." } + sed s/.*\(...\)\..*/\1/ + tr -d 2 3 + tr [A-Z] [a-z] tr: The combination of options and String parameters is not legal. Usage: tr [ -c | -cds | -cs | -ds | -s ] [-A] String1 String2 tr [ -cd | -cs | -d | -s ] [-A] String1 |
![]() |
| Bookmarks |
| Tags |
| autosys |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|