05-06-2009
Read from script
Hi all.
I'm a newbie of bash scripting.
I need to create a script to have a rotate backup with 5 USB DISK on a work week.
With e2label, I've labelled all disk with all day of the week ( e.g. Monday, Tuesday, Thursday,... ).
How can I read if I've plugged the right device ?!?!
I find the right day with "date +%A".
Thanks a lot.
filloweb.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
If I don't want other user read my script, what can i do? :confused: (19 Replies)
Discussion started by: happyv
19 Replies
2. UNIX for Dummies Questions & Answers
Hi y'all...I've been wracking my brain over this very simple script that reads in a textfile and echos each line. But I keep getting an error.
Below is my script:
#!/bin/bash
while read myline
do
echo $myline
done < t_file-20080221.01.asc
The error I am getting is:
syntax error... (1 Reply)
Discussion started by: kevlar28
1 Replies
3. UNIX for Advanced & Expert Users
I have a script, except me no one can read the script but they can execute the script. Is it possible? (14 Replies)
Discussion started by: kingganesh04
14 Replies
4. Shell Programming and Scripting
Can someone please give me a big help?
I'm trying to read the file below, which have the format:
query,XX,XX,6559,0.132,0.210,0.108,0.03%
query,XX,XX,6559,0.132,0.210,0.108,0.03%
query,XX,XX,6559,0.132,0.210,0.108,0.03%
Need to get the 4th value: 6559 and sum all and put it into a var:
... (2 Replies)
Discussion started by: letakeda
2 Replies
5. Shell Programming and Scripting
Hi all,
Actually I have a huge bash file like:
port1=$PORT && if ; then .....
....stuff
port2=$PORT && if ; then .....
...stuff
port3=$PORT && if ; then .....
...stuff
port4=$PORT && if ; then .....
...stuff
port5=$PORT && if ; then .....
I would like to change the $port inside... (2 Replies)
Discussion started by: Dedalus
2 Replies
6. Shell Programming and Scripting
Hi All,
Can someone help steer me to the simplest approach to write a script that reads the second column of a csv file and returns the highest value.
example file:
DATE,QUANTITY
Mon Apr 30 01:56:00 2012,42
Mon Apr 30 02:24:00 2012,72
Mon Apr 30 02:56:00 2012,102
Mon Apr 30 02:59:00... (3 Replies)
Discussion started by: dekker74
3 Replies
7. UNIX for Dummies Questions & Answers
I am very new to all these programming languages and really love Linux but have only begun to dive into bash scripting... I am curious what's going on with this script...
#!/bin/bash
if ; then
# xen
grep control_d /proc/xen/capabilities >& /dev/null
if ; then
# domU -- do not run on... (2 Replies)
Discussion started by: BrianBlaze
2 Replies
8. Shell Programming and Scripting
# cat /tmp/checkdate.log
SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 17 22:49:00 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
FIRST_TIME NEXT_TIME... (1 Reply)
Discussion started by: SarwalR
1 Replies
9. Shell Programming and Scripting
Hi All,
How I can read on variable with cycle for in bash script e.g.#!/bin/bash
VAR1=`command1 sentence list`
for i in $(cat $VAR1);
do
VAR2=`command2 $i`
echo $VAR2
doneSo read VAR1 execute command over this and load in VAR2 then print VAR2,
Thanks you,
Please wrap... (1 Reply)
Discussion started by: aav1307
1 Replies
10. UNIX for Advanced & Expert Users
Hi All,
Please let me know how to read space between 2 words in script. It is reading only first chars ES,NZ. But after space it is not reading next 3 chars.
ES LPI
NZ GBL
FR LPI
DK LPI
for v_sob_cntry_cd in `cat /shared/set_of_books_cntry_cd_list.lst`
do
... (6 Replies)
Discussion started by: kiranparsha
6 Replies
LEARN ABOUT DEBIAN
nqs2pbs
nqs2pbs(1B) PBS nqs2pbs(1B)
NAME
nqs2pbs - convert NQS job scripts to PBS
SYNOPSIS
nqs2pbs nqs_script [pbs_script]
DESCRIPTION
This utility converts a existing NQS job script to work with PBS and NQS. The existing script is copied and PBS directives, #PBS , are
inserted prior to each NQS directive #QSUB or #@$ , in the original script.
Certain NQS date specification and options are not supported by PBS. A warning message will be displayed indicating the problem and the
line of the script on which it occurred.
If any unrecognizable NQS directives are encountered, an error message is displayed. The new PBS script will be deleted if any errors
occur.
OPERANDS
nqs_script
Specifies the file name of the NQS script to convert. This file is not changed.
pbs_script
If specified, it is the name of the new PBS script. If not specified, the new file name is nqs_script.new .
NOTES
Converting NQS date specifications to the PBS form may result in a warning message and an incompleted converted date. PBS does not support
date specifications of "today", "tomorrow", or the name of the days of the week such as "Monday". If any of these are encountered in a
script, the PBS specification will contain only the time portion of the NQS specification, i.e. #PBS -a hhmm[.ss]. It is suggested that
you specify the execution time on the qsub command line rather than in the script.
Note that PBS will interpret a time specification without a date in the following way:
- If the time specified has not yet been reached, the job will become eligible to run at that time today.
- If the specified time has already passed when the job is submitted, the job will become eligible to run at that time tomorrow.
PBS does not support time zone identifiers. All times are taken as local time.
SEE ALSO
qsub(1B)
Local nqs2pbs(1B)