Search Results

Search: Posts Made By: gnnsprapa
12,082
Posted By gnnsprapa
thanks for the suggestion @ctac_ i tried that...
thanks for the suggestion @ctac_
i tried that but it was not giving me desired result as if i give 4 parameters the last parameter i.e. "-f" was taking first parameter's argument so i made some...
12,082
Posted By gnnsprapa
Getopts with optional parameters
Hi Unix Gurus,

i am on learning path of unix, and yet to discover many things. I came across with this requirement where i need to pass parameters but the position of parameters is not fixed so...
674
Posted By gnnsprapa
How to extract when filename contains file seperator..?
Hi,
I want to extract part of filename, for eg:

File="010020004_S-TOR-Sort-CASAP_20170519_121504_0007.TXT"

here i need first 5 words of file i.e.

FilePart="$(echo...
11,729
Posted By gnnsprapa
Check if file is EBCDIC or ASCII format
So, i have this requirement where i need to check the file format, whether it's EBCDIC or ASCII, and based on format retrieve the information from that file:

my file is:

file1.txt-->this ebcdic...
1,891
Posted By gnnsprapa
thansk RudiC:b:
thansk RudiC:b:
1,891
Posted By gnnsprapa
Sort and remove duplicates in directory based on first 5 columns:
I have /tmp dir with filename as:

010020001_S-FOR-Sort-SYEXC_20160229_2212101.marker
010020001_S-FOR-Sort-SYEXC_20160229_2212102.marker
010020001-S-XOR-Sort-SYEXC_20160229_2212104.marker...
2,320
Posted By gnnsprapa
Hey RudiC,Don,scrutnizer thanks a lot for your...
Hey RudiC,Don,scrutnizer thanks a lot for your solutions...every solution worked so i am using

echo "${f%[-_]"${f#*[_-]*[-_]*[_-]*[_-]*[_-]*}"}"

It parse all the types of filename i receive,...
2,320
Posted By gnnsprapa
my shell version: echo $BASH_VERSION ...
my shell version:
echo $BASH_VERSION
4.1.2(1)-release
2,320
Posted By gnnsprapa
@RudiC while trying this.i got output as ...
@RudiC
while trying this.i got output as
f=010020001_S-FOR-Sort-SYEXC_20180109_062320_0100.x937
echo ${f%[-_]${f#*[_-]*[-_]*[_-]*[_-]*[_-]*}}
010020001_S-FOR-Sort-SYEXC_20180109_062320_0100.x937...
2,320
Posted By gnnsprapa
thanks for suggesting the solution: I got this ...
thanks for suggesting the solution: I got this

010020001S-FOR-Sort-SYEXC

its missing the first underscore(_) between first 2 words of filename
2,320
Posted By gnnsprapa
awk to print filename words along with delimiter
Hi,
I have filename as:
010020001_S-FOR-Sort-SYEXC_20180109_062320_0100.x937

I need first 5 words of my filename along with the respective delimiters:
I tried this:
...
863
Posted By gnnsprapa
Sort the filenames
Hello Unix experts:
I have dir where few files are there, i want to sort these files and write the output to some other file but i need filenames with filepath too
eg:

i have filenames like
...
3,258
Posted By gnnsprapa
Hi Don Cragun, My requirement is litle bit...
Hi Don Cragun,
My requirement is litle bit changed..instaed creating dynamic dir i want to send to these files to file list but not all files together rather first only one group set of files and...
3,258
Posted By gnnsprapa
Thanks a lot Don Cragun, please find below the...
Thanks a lot Don Cragun,
please find below the output

-bash-4.1$ uname -a
Linux ucsdv181.symprod.com 2.6.32-696.10.3.el6.x86_64 #1 SMP Thu Sep 21 12:12:50 EDT 2017 x86_64 x86_64 x86_64...
3,258
Posted By gnnsprapa
My bash version : -bash-4.1$ echo $BASH_VERSION...
My bash version :
-bash-4.1$ echo $BASH_VERSION
4.1.2(1)-release

Is this the way to get the version or is it something else.

I guess i have made my requirement bit complicated,

so...
3,258
Posted By gnnsprapa
Grouping files on pattern
I have this Requirement where i have to group the files,
I have a folder say "temp" where many files resides...files are like this;
010020001_S-ABC-Sort-DEFAW_YYYYMMDD_HHMMSS.txt...
1,220
Posted By gnnsprapa
@ashok: Thanks for the response, i would try...
@ashok:

Thanks for the response, i would try it, mean while can u please tell me what each command stands for

$ find sourcedir/ -type f -exec mv -v {} ts \; > move.log

and where i should...
1,220
Posted By gnnsprapa
Move files from one folder to another along with directory indicator
Hi All,

I have directory and it has multiple sub directories and all these sub directories contains many files. i want to move all these files to one different directory. But after moving files i...
2,092
Posted By gnnsprapa
as i told i might be getting 1000 files in 100...
as i told i might be getting 1000 files in 100 sub directories, i cannot write manual path for each and every file.
So i would need generic script which will handle any amount of files residing in...
2,092
Posted By gnnsprapa
here is another detailed eg: test--is my...
here is another detailed eg:

test--is my parent directory and it has many files such as
a1.txt
a2.txt
a3.txt

test1--subdirectory(under test)
b1.txt
b2.txt

test2--subdirectory(under...
2,092
Posted By gnnsprapa
Rename files from multiple directories along with directory indicator
Hi,

Friends, i have a requirement where i need to rename my files residing in multiple sub directories and move them to one different directory along with some kind of directory indicator.
For...
2,926
Posted By gnnsprapa
i tried using 2>logfile in log file i am...
i tried using 2>logfile

in log file i am getting following details:
ftp: connect: Connection timed out
Not connected.
Successful ftp...0 2014-01-31-09.15.33


Now in my code i want to go to...
2,926
Posted By gnnsprapa
i tried below script: ...
i tried below script:
log=/opt/app/vertica/cdr/tmp/hpcom/sftp.txt
LOGINID=abc
HOST=sftp2.xyz.com
echo "starting ftp & sftp...." > $log
ftp -i -n -v $HOST <<-EOFtp >$log
user $LOGINID $PASSWD...
2,926
Posted By gnnsprapa
yes i tried few things, for ftp: ftp...
yes i tried few things,

for ftp:

ftp -i -n -v ${FTPIP} <<-EOFtp >>${PREPLOG} 2>&1
user $LOGINID $PASSWD
cd $LOCALPATH
binary
mget *.*
dir *...
2,926
Posted By gnnsprapa
FTP and SFTP functionality
Hi Friends,

I need to make a Unix script, where i need ftp and sftp functionality.
Let me describe in details:

I need to import few files from remote server, now these remote server either...
Showing results 1 to 25 of 51

 
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy