![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Awk:Find length of string omitting quotes | jayakumarrt | Shell Programming and Scripting | 2 | 05-09-2008 04:48 AM |
| omitting lines from file A that are in file B | gneen | Shell Programming and Scripting | 14 | 02-20-2008 05:33 AM |
| Get the words.. | kakashi_jet | Shell Programming and Scripting | 10 | 07-31-2006 10:30 AM |
| Omitting some filenames for commands to process | milhan | Shell Programming and Scripting | 5 | 05-19-2006 07:49 PM |
| Extracting only Alphabets from a value | amitkhiare | UNIX for Advanced & Expert Users | 2 | 02-22-2006 03:24 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi Guys,
Bit new to Unix shell scripting so this question might seems little kiddish for you. what im trying to achieve here is : I have file which is compressed like Account_52320090605076_log.Z so in my shell script i call this file also as one of my parameters like ./Information.sh DBNAME USERNAME DIREC_LOC Account_52320090605076_log.Z what i need here is 1. Check if the file has a .Z or .z at its end . if yes then uncompress it after uncompress the DUMPFILE_NAME should have a new paramater without the .Z extension 2. If no then proceed with the next step my script looks like this #!/bin/ksh DB_NAME=$1 USER_NAME=$2 DIR_LOC=$3 DUMPFILE_NAME=$4 LINE=$DUMPFILE_NAME; export LINE VAR=`echo $LINE |awk -F. '{print $3}`;export VAR echo $VAR if [ "$VAR" = "z" ] || [ "$VAR" = "Z" ] then uncompress $DUMPFILE_NAME chmod 744 `echo $LINE |awk -F. '{print $1"."$2}'` DUMPFILE_NAME=$LINE |awk -F. '{print $1"."$2}' ; export DUMPFILE_NAME echo $DUMPFILE_NAME fi echo $DUMPFILE_NAME but it seems like lines doesn't fetch me the correct result , could some one help and let me know a correct command that i can use for this situation. thx rekz |
| Bookmarks |
| Tags |
| alphabets, omitting, rekz |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|