I saw you also posted this code which is more simple:
So I am using this instead as I better understand what is happening as I did not really understand the "!val".
Best
Hi Experts,
I have a shell script called "updatevs" that is scheduled to run at 6.00 am everyday via cronjob. The cronjob will execute this script and output to a log file. The functionality of this script is to read the database and run a set of commands. This script is generally successful... (6 Replies)
I'll try explain this as best I can. Let me know if it is not clear.
I have large text files that contain data as such:
143593502 09-08-20 09:02:13 xxxxxxxxxxx xxxxxxxxxxx 09-08-20 09:02:11 N line 1 test
line 2 test
line 3 test
143593503 09-08-20 09:02:13... (3 Replies)
Hi,
I have a written a shell script to get the previous line based on the pattern.
For example if a file has below lines:
----------------------------------------------
#UNBLOCK_As _per
#As per
205.162.42.92
#BLOCK_As_per
#-----------------------
#input checks
abc.com... (5 Replies)
Need help creating a script that does the following:
Sort a file
Compare the previous line "last field" with current line "last field"
If they are the same, print output to a file
If they are different print output to a new file
The script should keep creating new files if the previous... (5 Replies)
I am database guy and not very good at shell scripts. I am seeking help to sharp my script coding. I have 5 scripts
1. master script. I use this one to call other four scripts to do database work.
2. db_backup_1 and log_backup_1
3. db_backup_2 and log_backup_2
in master script, I want to... (4 Replies)
I need to read the contents of a file. Then I need to grep for a keyword and replace part of the grepped line based on the condition of previous and present line.
Example input file:
V {
port1 = P;
port2 = 0;
shift_port = P0; /* if next shift_port is P0 I need... (9 Replies)
Suppose i have multiple line like below in a file.
ASDFAFAGAHAHAHA
AGAHAHAJGAFAGAH
AHAHAKAHAHAHAKA
I need a bash script to count a character and also Also count the number of character present in each line .
suppose for line 1: A=x, S=y, D=x and so on and total character=15. where x y and z is... (3 Replies)
Hi all,
From a while loop I am reading a sorted file where I want to print only the lines that have $1 match and $2 only when the difference from $2 from the previous line is > 30.
Input would be like ...
AN237 010 193019 0502 1 CSU Amoxycillin
AN237 080 ... (2 Replies)
Hello,
I am trying to return a time multiple times from a file that has varying output just before the time instance, i.e.
cat jumped
cat jumped
cat jumped
time = 1.1
cat jumped
cat jumped
time = 1.2
cat jumped
cat jumped
time = 1.3
In this case i would like to output a time.txt... (6 Replies)
Hi All-I am new to Unix , I need to write a script. Can someone help me with a requirement where I have list of files in a directory, I want to Merge the files if a pattern of string matches in filenames?
AAAL_555A_ORANGE1_F190404.TXT
AAAL_555A_ORANGE2_F190404.TXT
AAAL_555A_ORANGE3_F190404.TXT... (6 Replies)