![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Government Security Standard Compliant Kickstarts 0.01 (Default branch) | iBot | Software Releases - RSS News | 0 | 04-19-2008 03:30 AM |
| How to sort standard input without first line < Header > | pp56825 | Shell Programming and Scripting | 8 | 03-26-2008 02:25 PM |
| How to copy from standard input | lalelle | Shell Programming and Scripting | 2 | 08-24-2007 04:36 AM |
| permanent redirection of standard input | gfhgfnhhn | Shell Programming and Scripting | 6 | 11-01-2006 04:52 AM |
| standard input | Jariya | Shell Programming and Scripting | 1 | 06-06-2006 12:49 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Security Issue with Standard Input?
Hi Gang,
Running a script in AIX 5.3. Users wanted me to add a "confirm you want to run script, enter 'y' or 'n'" kind of thing... here is what I came up with: #!/bin/sh myfile=`basename "$1"` dateNow=`date "+%m.%d.%Y.%H.%M.%S"` # Get current date mydatedfile=$myfile.$dateNow appfolder="/home/43168134/prod" newfolder="/home/43168134/arch" echo "Are you sure you want to approve $myfile ?" echo "" echo "Okay?("Y" or "N")=> " set ret = "$<" if ("$ret" != "y" && "$ret" != "Y") then echo "" echo "" echo "End." exit 0 else if [ -s "$myfile" ]; then mv "$myfile" "$appfolder/$myfile" # Move file to another folder cp -p "$appfolder/$myfile" "$newfolder/$mydatedfile" # Copy file with new archive name print "$myfile has been moved to Production and Archived." else print "$myfile does not exist or is empty." exit 1 fi fi exit 0 When I run the script, I get this: $ approveTEST.sh CallidusFile3.csv Are you sure you want to approve CallidusFile3.csv ? Okay?(Y or N)=> approveTEST.sh[13]: : 0403-006 Execute permission denied. CallidusFile3.csv has been moved to Production and Archived. The script does the move/copy OK, but won't accept any input and instead gives me an error. I did chmod 755 and 744 hoping that would fix it, but no luck. Any thoughts? Thanks in advance... |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|