Search Results

Search: Posts Made By: chetancrsp18
52,051
Posted By chetancrsp18
#filename=XXGT_IN*.txt ...
#filename=XXGT_IN*.txt
#src_dir=/dgltyi/applmgr/1200/xxgt/12.0.0/ftp/bacs
#dest_dir=insphire
filename=$5
src_dir=$6
dest_dir=$7
echo "File Name: " $filename
src_dir=`eval echo "$6"`
echo...
52,051
Posted By chetancrsp18
Yeah, I need to do the same operation but with 1...
Yeah, I need to do the same operation but with 1 command if possible.
52,051
Posted By chetancrsp18
Any command to delete files from source dir after SFTP copy
Hi,

I am currently using SFTP 'put' command to copy all files to remote server and then delete the copied files from source directory.

Can anyone help me with a single command to copy and...
1,907
Posted By chetancrsp18
Execution Problems with Cron
Hi,

I have written a shell script to transfer files to a SFTP server passing the filername, source and dest directory as parameters and it runs well. :)

I want to schedule this script to run...
27,495
Posted By chetancrsp18
Actually I want to transfer files on a specific...
Actually I want to transfer files on a specific sftp server. The command that I'm trying to move files is as follows:-
<CODE>
scp user@server:/var/path/XX_P.txt sftp -oPort=22 user@server:/dir...
27,495
Posted By chetancrsp18
I did this but it gives and error :- "Couldn't...
I did this but it gives and error :-
"Couldn't read packet: Connection reset by peer" :(
27,495
Posted By chetancrsp18
Thanks. I dont need a passwordless sftp. How...
Thanks. I dont need a passwordless sftp. How shall I transfer files to remote server using sftp then??
27,495
Posted By chetancrsp18
SFTP files from one server to another
Hi,

I want to transfer files from 1 server to another server using sftp.
Earlier what I use to do is transfer files on the same server using mv command.

Pls help.
9,788
Posted By chetancrsp18
It can have many filenames matching to XX*.txt /...
It can have many filenames matching to XX*.txt / XX*.dat conditions.
9,788
Posted By chetancrsp18
No, all filenames in the folder matching to...
No, all filenames in the folder matching to XX*.txt condtion like XXABC.txt, XXXYZ.txt etc. I hope now the requirement is clear to you?
9,788
Posted By chetancrsp18
The value passed to $filename parameter will be...
The value passed to $filename parameter will be like - XX*.txt / XXGT*.dat etc.
9,788
Posted By chetancrsp18
Hi itkamaraj, Actually, the value passed to...
Hi itkamaraj,

Actually, the value passed to $filename will be like XX*.txt, XX*.dat etc, so hard-coding .txt is not an option.

Can we make it dynamic based upon the filename passed?

Thanks.
9,788
Posted By chetancrsp18
Renaming a file and keep the extension of file as it is
Hi,

I am trying to rename multiple filenames in a UNIX directory matching a specific condition.



i=0
for file in `ls $filename`
do
echo "$file"
#echo $i
i=`expr $i + 1`
...
1,074
Posted By chetancrsp18
This was what i was trying to do. Now i have done...
This was what i was trying to do. Now i have done picking up the filenames and renaming all of them in a loop.



Code:
i=0
for file in `ls |grep "$filename"`
do
echo "$file"
echo $i...
3,670
Posted By chetancrsp18
Thanks. Yes this was what i was trying to do. ...
Thanks. Yes this was what i was trying to do. Now i have done picking up the filenames and renaming all of them in a loop.

i=0
for file in `ls |grep "$filename"`
do
echo "$file"
echo $i...
1,074
Posted By chetancrsp18
Print and Append the matching filenames
Hi,

I want to check all files in a folder for some specific start string and append all matching filenames with _1, _2 .... for each file found in the directory.
But, $file below gives me all...
3,670
Posted By chetancrsp18
Now I find the no. of files and display the...
Now I find the no. of files and display the count. How can I display the maching filenames in display?? :S

---------- Post updated at 02:21 PM ---------- Previous update was at 01:40 PM ----------...
22,971
Posted By chetancrsp18
Thanks again :)
Thanks again :)
22,971
Posted By chetancrsp18
Ohk so here in the shell script i have to check...
Ohk so here in the shell script i have to check the permissions separately like I have done below.

if [ ! -r ${source} ]
then
echo "Read access permission denied on Source Directory"
exit 1...
22,971
Posted By chetancrsp18
Ok, so if i need to check for all r w x rights...
Ok, so if i need to check for all r w x rights can I do it in 1 command line?

if [ ! -rwx ${directory} ] ?

This gives an unary operator expected error. I believe we need to have an and...
3,670
Posted By chetancrsp18
Thanks a lot all of you. This solution...
Thanks a lot all of you.

This solution finally worked for me...... Here I find and count the number of files matching the start string....!!

ls -l |grep 'XX_GT'| wc -l

Cheers :)
22,971
Posted By chetancrsp18
Checking directory permissions on UNIX directory
Hi,

How do i check if I have read/write/execute rights on a UNIX directory?

What I'm doing is checking read access on the files but i also want to check if user has rights on the direcory in...
3,670
Posted By chetancrsp18
Yes, exactly...! I want to search in Folder and...
Yes, exactly...! I want to search in Folder and count if there are any files with files with filename like FILE* :)
3,670
Posted By chetancrsp18
Checking files in folder using starting string for filename
Hi,

How do i check if there are any files present in the folder with some specific starting string.

For eg :- I have used this where Source_File is filename parameter.

if [ ! -r...
4,856
Posted By chetancrsp18
Move all files from source to destination directory based on the filename
Move all files starting with a specific name to different directory.

This shell script program should have three parameters
File Name
Source Directory
Destination Directory

User should be...
Showing results 1 to 25 of 25

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