The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Help me in getting the desired output akash Shell Programming and Scripting 2 12-02-2007 11:27 AM
PZ help :configure: error: cannot find output from flex; giving up bullet350 SUN Solaris 0 11-29-2007 05:24 AM
egrep not giving desired results igandu Shell Programming and Scripting 3 11-14-2007 04:43 AM
Script not working as desired mhssatya Shell Programming and Scripting 39 08-23-2006 10:51 AM
Backup is giving me input/output error JPigford UNIX for Dummies Questions & Answers 8 01-28-2005 07:00 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-14-2008
Renjesh Renjesh is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 84
Exclamation script not giving the desired output

Hi,

I have a script in which an entry like this .....

FILENAME_B="PIC_${DATE}0732*.JPG"

The script connects to an ATM and pull a pic file from it.The format for the file is like PIC_2008061400000001.JPG in the ATM.

Means 1st 8 digit is the date(YYYYMMDD) field
2nd 8 digit means hrs min sec millsec
I want only one or two random pic files with in a particular time.

But the above entry can't pick a picfile and i can't give any random name in script.So i give the entry like above. Serve inwhich i wrote this script is an AIX server.
  #2 (permalink)  
Old 06-14-2008
na5m's Avatar
na5m na5m is offline
Registered User
  
 

Join Date: Jun 2008
Location: Sacramento, CA
Posts: 15
Here's a crufty way to select a random file in a directory:
Code:
$ ls | sort -R | sed '1!d'
I'm using gnu's sort (Ubuntu). Good luck!
  #3 (permalink)  
Old 06-15-2008
Renjesh Renjesh is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 84
My issue is while running the script this line is showing error
FILENAME_B="PIC_${DATE}0732*.JPG"
Means i want to repalce the * with seconds from(00 - 60sec)

And also
when i am trying to move the file like this

mv $FILENAME_B EJDATA.$ATMNAME.$DATE.TXT >> $LOGFILE
mkdir $ATMNAME
mv EJDATA.$ATMNAME.$DATE.JPG $ATMNAME >> $LOGFILE

It showing permission error............
Please do you have any idea?
Closed Thread

Bookmarks

Tags
linux, ubuntu

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0