Help to Modify File Name in each function before calling another function.
I have a script which does gunzip, zip and untar.
Input to the script is file name and file directory (where file is located)
I am reading the input parameters as follows:
I have created 3 functions that are as follows:
1) gunzip file
2) unzip file
3) untar file
Say suppose the file name received is as follows:
Quote:
FILENAME=mdm_ind_usa.2031.fsacm.tar.zip.gz
I would to modify the file name to "mdm_ind_usa.2031.fsacm.tar.zip" after gunzip is done in gunzip function is called
Now file name should become
Quote:
FILENAME=mdm_ind_usa.2031.fsacm.tar.zip
I would to modify the file name to "mdm_ind_usa.2031.fsacm.tar" after unzip is done in unzip function is called.
Now file name should become
Quote:
FILENAME=mdm_ind_usa.2031.fsacm.tar
and after untar function
Quote:
FILENAME=mdm_ind_usa.2031.fsacm
Help is appreciated in order modify the filename as required.
Please Note: File Name passed to script could have any number of "." and "_". The file name i provided is for example purpose only.
Actually file name would vary.
Hi,
I am pretty new to unix.
Lets say i have a program(run_program) that will call another file function(functiona, in same directory):
hence, inside that run_program. i will just call "functiona xx xx" to refer and use that function. this run ok until i run this program from another folder.... (3 Replies)
This may sounds dumb, but can I call on a function from a file? For example, I have a function file full of functions like below (no shell designation):
func { echo "blah blah blah 1" }
func2 { echo "blah blah blah 2" }
func3 { echo "blah blah blah 3" }
Am I able to call on any one... (3 Replies)
This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord
but only one record is getting wrote in DB.... Please advise ASAP...:confused:
function InsertFtg
{
FTGSTR=""
echo "Saurabh is GREAT $#"
let... (2 Replies)
Hi,
I have a shell script 'sample.sh' which has some functions as below.
#fun1
fun1()
{
date
}
#fun2()
{
echo hi
}
I want to run these functions as background processes and also redirect the output to a file. My function calling statements are in a different file 'sample.cfg' as... (3 Replies)
I need to
1.Open a csv
2.Process the csv i.e. Modify 2 column in the csv.
To modify the column the value needs to be passed to a pl/sql function and the return value should be updated
For eg:
If column 2 E,then E will be passed in database function
which will return Employee.
3. Write a... (5 Replies)
I have a function which does awk proceessing
sub mergeDescription {
system (q@awk -F'~' '
NR == FNR {
A = $1
B = $2
C = $0
next
}
{
n = split ( C, V, "~" )
if... (3 Replies)
In my prog if i enter the input for the 1st time it is executing correctly,
but for the second time entire script is not executing it just exiting
my code is
#!/bin/sh
checkpo()
{
echo "Checking the entered PO to create output text file ";
IFS=$'\n'
set -f
var=0
for i in $(cat... (3 Replies)
After some thought.
I am uncomfortable issuing my professors name where, there may be unintended side effects from any negative responses/feedback. Willing to re post if I can omit school / professor publicly, but can message moderator for validation? I am here for knowledge and understanding,... (1 Reply)