Sponsored Content
Top Forums Shell Programming and Scripting cp command not working in script for non unix file Post 302532809 by lalitpct on Wednesday 22nd of June 2011 06:44:22 AM
Old 06-22-2011
cp command not working in script for non unix file

Piece of code in sh file
------------------------
Code:
   echo "lalit test bef"
   which cp
   cp $l_options $srcdirfile $destdirfile
   echo "lalit test after"
   echo "**************************options below"
   echo "loption $l_options"
   echo "src $srcdirfile" 
   echo "destinat $destdirfile"
   ls -lrt /opt/smart/dev/eur/sources/scripts/upload/bases_pre_bcp_d.trg
   echo "\n ls end \n"
   echo "**************************"

debug mode output
------------------------
Code:
+ which cp
cp:      aliased to cp -i
+ cp -p /opt/smart/dev/eur/sources/request/9235_test/bases_pre_bcp_d.trg /opt/smart/dev/eur/sources/scripts/upload     -------------> this one 
+ echo lalit test after
lalit test after
+ echo **************************options below
**************************options below
+ echo loption -p
loption -p
+ echo src /opt/smart/dev/eur/sources/request/9235_test/bases_pre_bcp_d.trg
src /opt/smart/dev/eur/sources/request/9235_test/bases_pre_bcp_d.trg
+ echo destinat /opt/smart/dev/eur/sources/scripts/upload
destinat /opt/smart/dev/eur/sources/scripts/upload
+ ls -p -lrt /opt/smart/dev/eur/sources/scripts/upload/bases_pre_bcp_d.trg
/opt/smart/dev/eur/sources/scripts/upload/bases_pre_bcp_d.trg not found -----------------------------------> says no file and confirm no file
+ echo \n ls end \n

Manual copy
---------------
Code:
smt2uxb@SMARTDEV:/opt/smart/dev/eur/sources/coms >ls -lrt /opt/smart/dev/eur/sources/scripts/upload/bases_pre_bcp_d.trg
/opt/smart/dev/eur/sources/scripts/upload/bases_pre_bcp_d.trg not found
smt2uxb@SMARTDEV:/opt/smart/dev/eur/sources/coms >cp -p /opt/smart/dev/eur/sources/request/9235_test/bases_pre_bcp_d.trg /opt/smart/dev/eur/sources/scripts/upload
smt2uxb@SMARTDEV:/opt/smart/dev/eur/sources/coms >ls -lrt /opt/smart/dev/eur/sources/scripts/upload/bases_pre_bcp_d.trg
-rwxrwxr-x    1 smt2uxb  smt2uxb        1134 Jun 22 08:51 /opt/smart/dev/eur/sources/scripts/upload/bases_pre_bcp_d.trg

Just to add bases_pre_bcp_d.trg is non unix format , when i put the unix format it is copied properly .
The doubt which I have is that if it is non unix format why it doesnt give any error or anything

Last edited by pludi; 06-22-2011 at 08:09 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

2. Shell Programming and Scripting

help with shell script: cp command not working, but mv command works...

Hello. I would like to ask your help regarding the cp command. We are using a cp command to create a back-up copy of our file but to no avail. It's just not working. We already checked the file and directory permissions and all seems correct. We have a script (ftp.script) which calls on... (1 Reply)
Discussion started by: udelalv
1 Replies

3. Shell Programming and Scripting

FTP using script not working (for transfering file from a remote unix server to windows PC.)

hi, Im using the following code for FTP #!/usr/bin/ksh ftp -v -n "10.29.45.11" << cmd user "mahesva" "mahesva123" get rtl.tar quit cmd Below is the log when i run the above code ********************************** Connected to 10.29.45.11. 220 (vsFTPd 2.0.1) 530 Please login with USER... (20 Replies)
Discussion started by: dll_fpga
20 Replies

4. Shell Programming and Scripting

UNIX command in cron not working

the following unix command gives me the number of records avaiable in my application /navs/sys/appl/bin/record list This gives number of rows and colums. I want to generate one text file everyday at 6:10 AM using cron So I added following entery into crontable #Generate record file at... (6 Replies)
Discussion started by: Nakul_sh
6 Replies

5. Shell Programming and Scripting

sed Command not working in AIX UNIX

Hi 1st problem -------------- i have this sed command in my unix script which replaces new line and carriage return in a line with the string "&#xA" the script works fine in Linux 3.0.101-0.5, but not in AIX 1 7 , the "s/\r/\&#xA/g" replacement, replaces all the character "r" in the file.... (3 Replies)
Discussion started by: maximus_jack
3 Replies

6. Homework & Coursework Questions

UNIX head command not working?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a script that allows the user to print the first n lines or the last n lines of every file in the... (18 Replies)
Discussion started by: lukefrost96
18 Replies

7. Shell Programming and Scripting

sed working on command line but file unchanged when execute with Shell script

I have a simple task to replace unix line feed end of line characters with carriage returns. When I run the following “change file in place” sed instruction from the command line all the Line feeds are successfully replaced with Carriage returns. sed -i 's/$/\r/' lf_file.txt But that same... (1 Reply)
Discussion started by: hawkman2k
1 Replies

8. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

9. UNIX for Advanced & Expert Users

Converting xls file to xlsx on UNIX script / command line.

Hi All, Am needing advise on how to convert xls file to xlsx format on Solaris unix command line or scripting. I tried searching online but it looks like I need to either use Perl packages of Excel or Python packages or some other 3rd party tool. Problem is to install any of these will require... (2 Replies)
Discussion started by: arvindshukla81
2 Replies

10. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. --font=desc Set the font description. Default is Monospace 12. --rtl Do rtl layout. --paper ps Choose paper size. Known paper sizes are legal, letter, a4. Default is A4. --bottom-margin=bm Set bottom margin in postscript points (1/72 inch). Default is 36. --top-margin=tm Set top margin. Default is 36. --left-margin=lm Set left margin. Default is 36. --right-margin=rm Set right margin. Default is 36. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --encoding=ENCODING Assume the documentation encoding is ENCODING. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 08:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy