Hi there, In the following test, how to use shell var for pattern, regular expression. I need to accept pattern at argument, use it to pattern matching at shell script.
Test:
Last edited by Franklin52; 09-09-2009 at 08:21 AM..
Reason: Please use code tags!
Ih all,
i have multiples ksh scripts for crontab's unix jobs
they all have same variables declarations and some similar functions
i would have a only single script file to declare my variables, like:
var1= "aaa"
var2= "bbb"
var3= "ccc"
...
function ab { ...}
function bc { ... }... (2 Replies)
Anyone knows why the following function does not work in ksh (it does in bash)?
var() # Displays var value; case insensitive
{
_var="$1"
if ; then
echo ${!_var}
else
_var=$(echo "$_var" | tr 'a-z' 'A-Z')
echo ${!_var}
fi
unset _var
}$ var home
ksh:... (4 Replies)
hi,
i can see in a script
it contains
var=$(
myFile | grep -i err
)
why has this person done it like this? why not just
var=`myFile | grep -i err`
thanks (9 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
This works
#!/bin/ksh
FILE="file.txt"
dosumtin () {
date >> FILE
}
for i in {1..5}
do
dosumtin
done
cat $FILE
But instead of building a file, I want to do the same with a var or an array. That is, to build one that saves all 5 of the subs execution responses in a var or an... (8 Replies)
Using ksh, I am using SQLPlus to execute a query with a filter using a string variable.
REPO_DB=DEV1
FOLDER_NM='U_nmalencia'
FOLDER_CHECK=$(sqlplus -s /nolog <<EOF
CONNECT user/pswd_select@${REPO_DB}
set echo off heading off feedback off
select subj_name
from subject
where... (5 Replies)
i try to find way to make string concatenation in csh ( sorry this is what i have )
so i found out i can't do :
set string_buff = ""
foreach line("`cat $source_dir/$f`")
$string_buff = string_buff $line
end
how can i do string concatenation? (1 Reply)
The sample file:
dept1: user1,user2,user3
dept2: user4,user5,user6
dept3: user7,user8,user9
I want to match by '/^dept2.*/' but don't want to have substring 'dept2:' in output. How to compose such regex? (8 Replies)
My variable contains the following string
I wish to replace \n with "space" so the expected output is:
I understand that the /n is not a new linein this case.
I'm on AIX using ksh shell. Below is all that I tried.
echo $str | sed -e "s#\n# #g";
echo $str | sed -e "s#\n#' '#g";... (5 Replies)
Discussion started by: mohtashims
5 Replies
LEARN ABOUT DEBIAN
stg-import
STG-IMPORT(1) StGit Manual STG-IMPORT(1)NAME
stg-import - Import a GNU diff file as a new patch
SYNOPSIS
stg import [options] [<file>|<url>]
DESCRIPTION
Create a new patch and apply the given GNU diff file (or the standard input). By default, the file name is used as the patch name but this
can be overridden with the --name option. The patch can either be a normal file with the description at the top or it can have standard
mail format, the Subject, From and Date headers being used for generating the patch information. The command can also read series and mbox
files.
If a patch does not apply cleanly, the failed diff is written to the .stgit-failed.patch file and an empty StGIT patch is added to the
stack.
The patch description has to be separated from the data with a --- line.
OPTIONS -m, --mail
Import the patch from a standard e-mail file.
-M, --mbox
Import a series of patches from an mbox file.
-s, --series
Import a series of patches from a series file or a tar archive.
-u, --url
Import a patch from a URL.
-n NAME, --name NAME
Use NAME as the patch name.
-p N, --strip N
Remove N leading slashes from diff paths (default 1).
-t, --stripname
Strip numbering and extension from patch name.
-i, --ignore
Ignore the applied patches in the series.
--replace
Replace the unapplied patches in the series.
-b BASE, --base BASE
Use BASE instead of HEAD for file importing.
--reject
Leave the rejected hunks in corresponding *.rej files.
-e, --edit
Invoke an editor for the patch description.
-d, --showdiff
Show the patch content in the editor buffer.
-a "NAME <EMAIL>", --author "NAME <EMAIL>"
Use "NAME <EMAIL>" as the author details.
--authname AUTHNAME
Use AUTHNAME as the author name.
--authemail AUTHEMAIL
Use AUTHEMAIL as the author e-mail.
--authdate AUTHDATE
Use AUTHDATE as the author date.
--sign
Add a "Signed-off-by:" to the end of the patch.
--ack
Add an "Acked-by:" line to the end of the patch.
STGIT
Part of the StGit suite - see linkman:stg[1]
StGit 03/13/2012 STG-IMPORT(1)