Sponsored Content
Contact Us Post Here to Contact Site Administrators and Moderators How to Post in the The UNIX and Linux Forums How to run the files in Linux shell scipt? Post 303009698 by pavand on Monday 18th of December 2017 04:21:21 PM
Old 12-18-2017
How to run the files in Linux shell scipt?

I have a homework and I tried to work on this but unable to find the solution. Can someone help me how to resolve the issue.

I have a package file and it contains text file as prod.ame300_000001.101414145111.A.txt.
In the text file it contains pdf file (222222222|ZRF|2008.pdf|2008|01/29/2009|001|B|C|C)

Step1:
I have to check the index file is for A file or B file.

Step 2:
Read the first line of the original index file.

Step 3:
Read the 9th character of the line and check if the character is “|” or not

Step 4:
Based on the above, if it is “|”, it means the package is for A file, if not, it is for B file.

Step5:
Create a variable named “isA” and assign “true” or “false” value based on the above condition.



Please find the below code I have tried:
if [ -f "$indexFile" ]
then
echo "A"$indexFile" exist."
FIRSTLINE=`head -n 1 $indexFile

while read -r line
do
id = cut -c 9 $FIRSTLINE
echo $id
done < "$indexFile"

else
echo "A" $indexFile" does not exist"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

want to run different files under the same program using shell script

suppose have different files 1.1 2.2 3.3 4.4 5.5 All the files have to run under the same command say tr -d '\n' so how to run all the files under the same command by using shell script (3 Replies)
Discussion started by: cdfd123
3 Replies

2. UNIX for Advanced & Expert Users

find command from shell scipt (ksh) problem

Hi experts, I have a simple shell script as follows. #!/bin/ksh FIND_STRING="\( -name 'testfile*.Z' -o -name 'DUMMY_*' \) " find /tmp -type f $FIND_STRING -print When I run this with ksh -x testscript, I get the following output. + FIND_STRING=\( -name 'testfile*.Z' -o -name... (6 Replies)
Discussion started by: kodermanna
6 Replies

3. Shell Programming and Scripting

trigger a script based on the run status of another scipt

Im a newbee.. I have a script which runs few times daily. I want to write another script which should pick up the latest log generated from the last run of the first job and trigger a thrid script if the first script runs successfuly. Please help... Cheers (1 Reply)
Discussion started by: Athena
1 Replies

4. Shell Programming and Scripting

shell script to run .sql files

hi Friends, Please help me in writing shell script to run list of sql files. database is Oracle 9i, unix os is solaris Requirement is 1. sql file must take two inputs a)feed id and b)business date 2.shell script must out put .xls or .csvfile as out put without trimming any column name and... (1 Reply)
Discussion started by: balireddy_77
1 Replies

5. Shell Programming and Scripting

help needed. run shell scipt remotely

Dear all , I have a script. this script called get.sh and can get some solaris infomation and save the result as result.tar.gz. the problem is : we have 12 servers. every time. I need to login 12 server and do the same job 12 times.:mad: master server ... (2 Replies)
Discussion started by: chinesefish
2 Replies

6. Shell Programming and Scripting

Change the font of text in output file in shell scipt

hi, I want to change the font of text in output file. :( I tried the below code code: if awk 'BEGIN{if('$RSS'>='1000')exit 0;exit 1}' then RED=`echo "\033 i can see colors in terminal but not in output file :wall: please help me how i can get colors text in output file. edit... (1 Reply)
Discussion started by: sreelu
1 Replies

7. Shell Programming and Scripting

How to run multiple instances of shell script in linux?

How we can run the multiple instances of the script? I need to run the script which I am calling from the below function.I can doit with cron but I don't want to put it in the cron.This cript dploy the build and here I want when the build stage then it should run with multilpe instances of... (6 Replies)
Discussion started by: anuragpgtgerman
6 Replies

8. Shell Programming and Scripting

Read files in shell script code and run a C program on those files

HI, I am trying to implement a simple shell script program that does not make use of ls or find commands as they are quite expensive on very large sets of files. So, I am trying to generate the file list myself. What I am trying to do is this: 1. Generate a file name using shell script, for... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

9. Shell Programming and Scripting

Shell file to run other shell files running jar files

Hi, I am trying to write a shell script that will go to another folder and run the script in that folder. The folder structure is kind of like this: /MainFolder/ |-> MainShellScript.sh | |-> Folder1/ |-----|-> script1.sh |-----|-> FileToRun1.jar | |-> Folder2/ |-----|-> script2.sh... (3 Replies)
Discussion started by: sleo
3 Replies

10. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies
PCIC(4)                                                    BSD Kernel Interfaces Manual                                                    PCIC(4)

NAME
pcic -- PC Card bridge driver SYNOPSIS
device pcic device pccard DESCRIPTION
The pcic driver provides support for older ISA and non-Yenta PCI PC Card bridges. The pcic driver supports most ExCA devices attached to the ISA bus or PCI devices that do not conform to the Yenta specification. The following ISA devices, or true clones, are supported in the current code. Intel i82365SL Step A Intel i82365SL Step B Intel i82365SL Step C Intel's original 16-bit PC Card controller. Intel i82365SL-DF Intel's last version of this device. 3.3V support was added. VLSI 82C146 An older VLSI part with some issues on some machines. Cirrus Logic PD-6710 Cirrus Logic PD-6720 Cirrus Logic PD-6722 Cirrus Logic's pcic controller. Compatible with the i82365SL Step C with the addition of a different 3.3V control. Ricoh RF5C296 Ricoh RF5C396 Ricoh's PC Card bridge chips. These are compatible with the i82365SL Step C, but with yet another different 3.3V con- trol. Vadem 365 Vadem 465 Compatible with i82365SL Step C. Vadem 468 Vadem 469 Like the earlier Vadem models, but with Vadem's own, incompatible, 3.3V control system. IBM PCIC IBM clone of the original i82365SL part, with its own ID register value. Has no 3.3V ability. Many other vendors made parts in this arena, but most of them were compatible with one of the above chipsets. The following PCI pcmcia bridges are supported: Cirrus Logic PD6729 Cirrus Logic PD6730 O2micro OZ6729 O2micro OZ6730 BUGS
This does not work at all at the moment. BSD July 9, 2002 BSD
All times are GMT -4. The time now is 12:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy