Sponsored Content
Top Forums Shell Programming and Scripting Help with copying from one drive to another with cgi & ksh script Post 303019581 by Paul Walker on Monday 2nd of July 2018 02:01:56 PM
Old 07-02-2018
Help with copying from one drive to another with cgi & ksh script

Hi I was hoping some one could help me with a problem I have with a .cgi script I am running in the korn shell.
I have created a web form that user fill out to gather information that I use a .cgi and sed script to translate into a xml file which is further processed by another program.

All is well except for one final glitch, the .cgi script I am using will not copy the final .xml file to its final destination on another disk on our network.
I can copy the files to their final network location if I open another shell without a problem - just the current shell that is running the cgi refuse to do so.
I have tried every way around this I know and I still can not get the current shell running the .cgi script to do as I have asked.
If any one has a suggestion that I could try I would be very thankful for your help as I am at my wits end.
Below Is some of the relevant code I am using
Code:
#!/bin/ksh
NOW=$(date +"%Y-%m-%d-%HH-%MM-%SS")
print "Content-type: text/plain\r\n\r"
print "my query string from (GET) is \"$QUERY_STRING\"" | cat > /Library/Server/Web/Data/Sites/PrinergyHome.tigroup.ca/Workspace/$NOW
print "\nWorking..."
cat
sed -i '' -e s'/.*\"Section0Begin/Section0Begin/g' /Library/Server/Web/Data/Sites/PrinergyHome.tigroup.ca/Workspace/$NOW 
sed -i '' -e s'/JobName\=/JobName\=\$\"/g' /Library/Server/Web/Data/Sites/PrinergyHome.tigroup.ca/Workspace/$NOW 
sed -i '' -e s'/&Section0End/"&Section0End/g' /Library/Server/Web/Data/Sites/PrinergyHome.tigroup.ca/Workspace/$NOW 
sed -i '' -e s'/\(\&Section[0-9]End\=Section[0-9]End\&\)/\1\'$'\n/g' /Library/Server/Web/Data/Sites/PrinergyHome.tigroup.ca/Workspace/$NOW 
and on and on...

Below is the line of code that I just cant seem to make work.
Code:
cp /Library/Server/Web/Data/Sites/PrinergyHome.tigroup.ca/XML-Library/$NOW-Sec00.xml  /Volumes/AraxiVolume_HW07376_J/Jobs/funnel_Create_Job_Impo/HotFolders/Funnel_CreateImpos_05_22_18/$NOW-Sec00.xml

I would be very grateful for any assistance you can provide.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

CGI passing arrays/hashes to another CGI script

If I have a Perl CGI script (script01), which fills an array(s) with information and outputs a HTML page with a link to another CGI page (script02); is there anyway to pass the array(s) from "script01" to "script02" when the page visitor clicks the link? Hope that makes sense! :) (2 Replies)
Discussion started by: WIntellect
2 Replies

2. Shell Programming and Scripting

Executing ksh script from cgi

Hi all, I'm developing a system which requires me to run a ksh script from within a cgi script. What sort of syntax will I need to do this, I'm sure it's simple but can't find out how anywhere! Thanks. (1 Reply)
Discussion started by: hodges
1 Replies

3. UNIX for Dummies Questions & Answers

Run ksh script from cgi

Hi, I'm developing a system which requires me to run a ksh script from within a cgi script. What sort of syntax will I need to do this, I'm sure it's simple but can't find out how anywhere! Thanks. (2 Replies)
Discussion started by: hodges
2 Replies

4. Filesystems, Disks and Memory

The best partitioning schem for a 250GB Sata hard drive & a 75GB SCSI hard drive

Hi I have 2 75GB SCSI hard drives and 2 250GB SATA hard drives which are using RAID Level 1 respectively. I wana have both FTP and Apache installed on them as services. I'm wondering what's the best partitioning schem? I wana use FC3 as my OS, so, I thought I can use the 75GB hard drive as the /... (0 Replies)
Discussion started by: sirbijan
0 Replies

5. AIX

Copying to tape drive throws error

Hi All I am trying to copy files present in a partition (server 2) which is mounted to a different server (server 1) as tape drive is connected to it. I ran the below command to copy files within a partition: svr01:root:/sunfileserver> tar -cvf * a <foldername>/<filename>/<filename> a... (4 Replies)
Discussion started by: vathsan
4 Replies

6. Shell Programming and Scripting

RCP for copying the files from one drive to other on Windows

Hi, I have a requirement to move the files between two drives in windows machine from Korn sheel. I came to know that It can be done through RCP. Can any one help me with syntax for connecting to Windows machine and moving the files with RCP in KSH? Thanks in advance. Double post.... (0 Replies)
Discussion started by: Raamc
0 Replies

7. UNIX for Dummies Questions & Answers

copying to an ntfs formatted flash drive

I copied some files from my Linux EXT4 box to an ntfs flash drive. I have ntfs-3g installed, and the files copied fine, but I could not view them on a Windows box. What happened? Did it not write them using NTFS? Did it mount the drive under a different file-system (is that even possible)? (1 Reply)
Discussion started by: glev2005
1 Replies

8. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

9. Red Hat

Copying data from USB CD Drive.

I need to perform operation as captioned. I found out USB CD Drive is attached, by running 'lsusb' command. I am trying to identify mechanism by which I could mount this USB CD drive to disk. After which I expect to copy the contents. Could anyone indicate how this could be performed ? (3 Replies)
Discussion started by: videsh77
3 Replies

10. UNIX for Advanced & Expert Users

The disk drive for /tmp is not ready yet or not present && the disk drive for /boot is not ready yet

Hi Team when I boot the server I get this 2 errors : the disk drive for /tmp is not ready yet or not present the disk drive for /boot is not ready yet or not present and its stay like that , I m using Ubuntu 12.04 please if someone have any idea how to fix that problem . (1 Reply)
Discussion started by: SULTAN01
1 Replies
cgi_neo_error(3)						     cgi/cgi.h							  cgi_neo_error(3)

NAME
cgi_neo_error - display a NEOERR call backtrace SYNOPSIS
#include <cgi/cgi.h> void cgi_neo_error (CGI *cgi, NEOERR *err); ARGUMENTS
cgi - a pointer to a CGI struct err - a NEOERR (see util/neo_err.h for details) DESCRIPTION
cgi_neo_error will output a 500 error containing the NEOERR call backtrace. This function is likely to be removed from future versions in favor of some sort of user error mechanism. RETURN VALUE
None SEE ALSO
cgi_debug_init(3), cgi_parse(3), cgi_destroy(3), cgi_js_escape(3), cgi_html_escape_strfunc(3), cgi_register_strfuncs(3), cgi_output(3), parse_rfc2388(3), cgi_url_validate(3), open_upload(3), cgi_cs_init(3), cgi_url_escape_more(3), cgi_html_strip_strfunc(3), cgi_neo_error(3), cgi_redirect(3), cgi_filehandle(3), cgi_register_parse_cb(3), cgi_url_escape(3), cgi_init(3), cgi_redirect_uri(3), cgi_cookie_clear(3), cgi_url_unescape(3), cgi_vredirect(3), cgi_display(3), cgi_html_ws_strip(3), cgi_error(3), cgi_cookie_set(3), cgi_text_html_strfunc(3), cgi_cookie_authority ClearSilver 12 July 2007 cgi_neo_error(3)
All times are GMT -4. The time now is 06:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy