Sponsored Content
Top Forums UNIX for Dummies Questions & Answers korn shell to bash - statement not working Post 302140432 by brdholman on Friday 12th of October 2007 11:29:31 AM
Old 10-12-2007
korn shell to bash - statement not working

Everything else seems to be working, but this isn't. Is it the "cat..." that is wrong of the condition? Thanks.


cat tc_result.txt | while read LINE
do
if [ "$LINE" == "*File*" ]
then
let "files_run += 1";
echo "inside the if loop"
# save current filetype
case $LINE in
"Running Engine to produce ECF File") file_type="ECF";;
"Running Engine to produce AFP File") file_type="AFP";;
"Running Engine to produce PostScript File") file_type="PostScript";;
"Running Engine to produce Metacode File") file_type="Metacode";;
"Running Engine to produce PCL File") file_type="PCL";;
"Running Engine to produce PDF File") file_type="PDF";;
"Running Engine to produce PPML File") file_type="PPML";;
"Running Engine to produce VIPP File") file_type="VIPP";;
"Running Engine to produce RTF File") file_type="RTF";;
"Running Engine to produce 3211 File") file_type="3211";;
"Running Engine to produce VPS File") file_type="VPS";;
"Running Engine to produce HTML File") file_type="HTML";;
esac
else
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if loop not working in BASH shell

i have this code for a simple if loop: #!/bin/bash array="1 2 3 4 5" array2="5 6 7 8 9" if } -gt ${array} ]; then echo "${array2} is greater than ${array}!!" fi the error is ./script8: line 9: [: too many arguments ./script8: line 9: [: too many arguments ./script8: line 9: [:... (10 Replies)
Discussion started by: npatwardhan
10 Replies

2. Shell Programming and Scripting

MKS Korn shell not working when schedule

Hi I have a sample MKS Korn Shell script, it is working fine when I am executing manually (i.e command prompt) but not when schedule through scheduler. here is the script, ls command working just fine manual run, so I thought it could be environment varilable so kept same PATH when running... (1 Reply)
Discussion started by: rkthoka
1 Replies

3. Shell Programming and Scripting

Difficulty with a couple commands porting from korn shell to bash

I am relatively new to shell scripting. I have a script I wrote that works fine in korn shell. I need to make it work in bash on a different server. There are a couple valid korn shell commands I am having difficulty finding the bash equivalents for. At one point the scripts prompts the... (5 Replies)
Discussion started by: inakajin
5 Replies

4. Shell Programming and Scripting

Pass values to case statement in a function korn shell

I'm in the process of writng a function that consists of a case statement is there a way of calling the function and passing a value to it? ie function1 () { case opt1 do ..... opt2 do..... esac } function opt1 I'm aware the syntax is not correct, but you get the general idea. (1 Reply)
Discussion started by: squrcles
1 Replies

5. UNIX for Dummies Questions & Answers

BASH Shell Scripting: If, Then Statement

I'm having trouble trying to create a BASH shell script. I want the user to input a command "cat file_name.c" and then the shell script will delete all comments "/* */" from file_name.c else exit. So far I have this: #!/bin/bash read "cat file" // User will input command cat... (7 Replies)
Discussion started by: inkjoy00
7 Replies

6. Shell Programming and Scripting

Korn shell script - SQL statement challenges

Hi scripting experts. I have some coding challenges that I'm hoping you can help me out. I have one file#1 that contains the following sql statement that spans over multiple lines: sql Select /*+ use_has(a,b) */ * from customer a, customer_address b where a.id = b.id... (1 Reply)
Discussion started by: pchang
1 Replies

7. Shell Programming and Scripting

Typeset is not working in Linux korn shell scripting

Hi All, Kindly help on the below issue ASAP. Its very urgent. I have script in which we have below two lines for code and it is not working. Please help. files_to_process=" abc_*.log def_*.log ghi_*.log " typeset -A dir_list ${files_to_process} the script is failing in Linux... (3 Replies)
Discussion started by: tvbhkishore
3 Replies

8. Shell Programming and Scripting

UNIX Korn Shell to Linux Bash

Migrating Unix batch jobs (Korn Shell) running in HP-UX server to Linux environment. Hi All Please help me to understand the easiest way to migrate Kernel Shell scripts to Linux Bash. Also let me know 1. Any automated scripts or tools available for this. 2. Challenges and issues... (5 Replies)
Discussion started by: cpremesh
5 Replies

9. Shell Programming and Scripting

Bash read input in case statement not working as expected

I'm having an issue with bash read input when using a case statement. The script halts and doesn't read the input on the first loop. if I hit enter then the scripts starts to respond as expected. Need some help here. defaultans=8hrs read -e -i $defaultans -p "${bldwht}How long would you like... (5 Replies)
Discussion started by: woodson2
5 Replies

10. Shell Programming and Scripting

While within while is not working in Korn shell

Hi all, I tried to execute a while within another while, but not working. Any suggestions? Thanks in advance #!/bin/ksh typeset -i i=1 typeset -i j=1 while ] do while ] do print i = $i j= $j (( j=j+1 )) done (( i=i+1)) done (3 Replies)
Discussion started by: Soham
3 Replies
DBM::Deep::Engine::File(3pm)				User Contributed Perl Documentation			      DBM::Deep::Engine::File(3pm)

NAME
DBM::Deep::Engine::File - engine for use with DBM::Deep::Storage::File PURPOSE
This is the engine for use with DBM::Deep::Storage::File. EXTERNAL METHODS
new() This takes a set of args. These args are described in the documentation for "new" in DBM::Deep. INTERNAL METHODS
The following methods are internal-use-only to DBM::Deep::Engine::File. read_txn_slots() This takes no arguments. This will return an array with a 1 or 0 in each slot. Each spot represents one available transaction. If the slot is 1, that transaction is taken. If it is 0, the transaction is available. write_txn_slots( @slots ) This takes an array of 1's and 0's. This array represents the transaction slots returned by "read_txn_slots()". In other words, the following is true: @x = read_txn_slots( write_txn_slots( @x ) ); (With the obviously missing object referents added back in.) get_running_txn_ids() This takes no arguments. This will return an array of taken transaction IDs. This wraps "read_txn_slots()". get_txn_staleness_counter( $trans_id ) This will return the staleness counter for the given transaction ID. Please see "STALENESS" in DBM::Deep::Engine for more information. inc_txn_staleness_counter( $trans_id ) This will increment the staleness counter for the given transaction ID. Please see "STALENESS" in DBM::Deep::Engine for more information. get_entries() This takes no arguments. This returns a list of all the sectors that have been modified by this transaction. add_entry( $trans_id, $location ) This takes a transaction ID and a file location and marks the sector at that location as having been modified by the transaction identified by $trans_id. This returns nothing. NOTE: Unlike all the other _entries() methods, there are several cases where "$trans_id != $self->trans_id" for this method. reindex_entry( $old_loc, $new_loc ) This takes two locations (old and new, respectively). If a location that has been modified by this transaction is subsequently reindexed due to a bucketlist overflowing, then the entries hash needs to be made aware of this change. This returns nothing. clear_entries() This takes no arguments. It will clear the entries list for the running transaction. This returns nothing. _write_file_header() This writes the file header for a new file. This will write the various settings that set how the file is interpreted. _read_file_header() This reads the file header from an existing file. This will read the various settings that set how the file is interpreted. _apply_digest( @stuff ) This will apply the digest methd (default to Digest::MD5::md5) to the arguments passed in and return the result. _add_free_blist_sector( $offset, $size ) _add_free_data_sector( $offset, $size ) _add_free_index_sector( $offset, $size ) These methods are all wrappers around _add_free_sector(), providing the proper chain offset ($multiple) for the sector type. _add_free_sector( $multiple, $offset, $size ) _add_free_sector() takes the offset into the chains location, the offset of the sector, and the size of that sector. It will mark the sector as a free sector and put it into the list of sectors that are free of this type for use later. This returns nothing. NOTE: $size is unused? _request_blist_sector( $size ) _request_data_sector( $size ) _request_index_sector( $size ) These methods are all wrappers around _request_sector(), providing the proper chain offset ($multiple) for the sector type. _request_sector( $multiple $size ) This takes the offset into the chains location and the size of that sector. This returns the object with the sector. If there is an available free sector of that type, then it will be reused. If there isn't one, then a new one will be allocated. ACCESSORS The following are readonly attributes. o byte_size o hash_size o hash_chars o num_txns o max_buckets o blank_md5 o data_sector_size o txn_bitfield_len The following are read/write attributes. o trans_id / set_trans_id( $new_id ) o trans_loc / set_trans_loc( $new_loc ) o chains_loc / set_chains_loc( $new_loc ) _dump_file() This method takes no arguments. It's used to print out a textual representation of the DBM::Deep DB file. It assumes the file is not- corrupted. perl v5.14.2 2012-06-24 DBM::Deep::Engine::File(3pm)
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy