Sponsored Content
Full Discussion: Check assign
Top Forums Shell Programming and Scripting Check assign Post 302982045 by jlliagre on Thursday 22nd of September 2016 03:16:31 PM
Old 09-22-2016
Code:
i=$((${#BUILD_FOLDER}-1))

${#BUILD_FOLDER} is the length (number of characters) of the variable BUILD_FOLDER

$(( xxx -1)) is xxx minus one

The resulting value is affected to i which then contains the offset of the last character of the string $BUILD_FOLDER
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to check for a file, check for 2hrs. then quit

I wish to seach a Dir for a specific file, once the file is found i will perform additional logic. If the file is not found within two hours, i would like to exit. Logically, I'm looking for the best way to approach this Thanks for any assistance in advance. Note: I'm using a C shell and... (2 Replies)
Discussion started by: mmarsh
2 Replies

2. Shell Programming and Scripting

how to check a word in a file and assign to a variable

Hi; I'm a newbie in UNIX, would appreciate for the help. I have a unix oracle script (lets call it orcl.sh) The scripts does a login via sqlplus and does some DDL. The orcl.sh script spool the output of the DDL into orcl.log The orcl.sh is executed via another script call A.sh. It is call... (1 Reply)
Discussion started by: hippo2020
1 Replies

3. Shell Programming and Scripting

Using bc to assign value

Friends here is code which is used to add floating point using bc, but I m not getting any output instead some errors. 1 #!/bin/bash 4 if 5 then 6 echo "Our input is from a Device" 7 while read myline 8 do 9 10 total= `echo $total + $myline... (2 Replies)
Discussion started by: navjinder
2 Replies

4. Shell Programming and Scripting

Assign the value

DATA --------------- 0 Please tell me, if the file contains 0 after --. then assign the value to variable $var=false, DATA --------------- 1 then $var=true, (2 Replies)
Discussion started by: sandy1028
2 Replies

5. UNIX for Advanced & Expert Users

Check EOF char in Unix. OR To check file has been received completely from a remote system

Advance Thanks. (1) I would like to know any unix/Linux command to check EOF char in a file. (2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
Discussion started by: alexalex1
5 Replies

6. Shell Programming and Scripting

how to assign value

#! /bin/bash if ; then echo "Set number " else k=$1 sqlplus ${scheme}/${apsswd}@${server} @query.sql $k fi file query.sql looks like this select * from tab1 where number =${k}; =================================== it doesnt work my question is how to assign k value in last... (2 Replies)
Discussion started by: kvok
2 Replies

7. Linux

HOW TO assign IP in REDHAT 6?

Hi Guys, It may sound silly questions but I am really confused and forgot the sequence to set IP in REDHAT 6. 1st type system-config-network then I give IP as 192.168.1.78 Subnet as 255.255.255.0 Then do /etc/init.d/network restart Then when I check with ifconfig eth0... (1 Reply)
Discussion started by: manalisharmabe
1 Replies

8. Shell Programming and Scripting

Perl code to check date and check files in particular dir

Hi Experts, I am checking how to get day in Perl. If it is “Monday” I need to process…below is the pseudo code. Can you please prove the code for below condition. if (today=="Monday" ) { while (current_time LESS THAN 9:01 AM) ... (1 Reply)
Discussion started by: ajaypatil_am
1 Replies

9. Shell Programming and Scripting

Unable to assign a value

I have written a shell script to calculate dbsize :- db2 "call get_dbsize_info(?,?,?,-1)" | sed -n '8p' | awk -F : '{print $2}' dbsize=`db2 "call get_dbsize_info(?,?,?,-1)" | sed -n '8p' | awk -F : '{print $2}'` echo $dbsize when I execute it the syntax works but it's not... (11 Replies)
Discussion started by: lazydev
11 Replies

10. Shell Programming and Scripting

Check unused ports in a given range and assign an open one

Hi. I need to add code to my KSH script to automatically assign an open port number from a pre-defined range to an Oracle listener. Should I use: lsof -i or netstat -vatn or something else? Thanks. (9 Replies)
Discussion started by: user052009
9 Replies
GUARDS(1)						User Contributed Perl Documentation						 GUARDS(1)

NAME
guards - select from a list of files guarded by conditions SYNOPSIS
guards [--prefix=dir] [--path=dir2:dir2:...] [--default=0|1] [-v|--invert-match] [--list|--check] [--config=file] symbol ... DESCRIPTION
The script reads a configuration file that may contain so-called guards, file names, and comments, and writes those file names that satisfy all guards to standard output. The script takes a list of symbols as its arguments. Each line in the configuration file is processed separately. Lines may start with a number of guards. The following guards are defined: +xxx Include the file(s) on this line if the symbol xxx is defined. -xxx Exclude the file(s) on this line if the symbol xxx is defined. +!xxx Include the file(s) on this line if the symbol xxx is not defined. -!xxx Exclude the file(s) on this line if the symbol xxx is not defined. - Exclude this file. Used to avoid spurious --check messages. The guards are processed left to right. The last guard that matches determines if the file is included. If no guard is specified, the --default setting determines if the file is included. If no configuration file is specified, the script reads from standard input. The --check option is used to compare the specification file against the file system. If files are referenced in the specification that do not exist, or if files are not enlisted in the specification file warnings are printed. The --path option can be used to specify which directory or directories to scan. Multiple directories are eparated by a colon (":") character. The --prefix option specifies the location of the files. AUTHOR
Andreas Gruenbacher <agruen@suse.de> (SuSE Linux AG) perl v5.12.1 2010-07-05 GUARDS(1)
All times are GMT -4. The time now is 12:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy