How to add extended calendar from JIL file - autosys

I am trying to add an extended_calendar in my autosys. Can i add the same using a jil file?
I tried using autocal_asc -I test.txt but that is giving me Calendar Create Access Denied!(same case with interactive cmd console using autocal_asc)
This is my sample contents of txt file
extended_calendar:test
description:Runs on 1st day of the month
workday: mo,tu,we,th,fr
non_workday:
holiday:
holcal:
cyccal:
adjust: 0
condition: MNTHD#1

Related

Assign HDFS location of Hive external table to a Unix variable

Is there a way to get hdfs location from external table and assign to unix variable.
Yes, there is a way.
Run a command like the below,
export location=hive -e "SHOW CREATE TABLE <dbname.tablname>;"| grep hdfs://
Please use after the equal sign on the above command and at the end. It is not shown here due to Stackoverflow's rich text format.
You can check the variable like the below,
echo $location
'hdfs://hostname:8020/HDFS/PATH/OF/THE/TABLE'
Hope this helps!

Working with Variables in multiple files Shell Scripts

While working with Config files (user defined variables in file) I need below requirement. I have variables in config files and need to read variables from files and order of precedence. Example as
given below
Main parameter (default) file.
param.ini:
Var1=today
Var3=xyz
Override parameter file (adhoc override changes)
Param.override:
var1=yesterday
var2=123
My script as given below
test.sh:
. ~/param.override,~/param.ini
echo "run day -> $var1"
Result i need is
run day -> yesterday
I remember we can achieve this using dot operator or Source command in Unix. Please help me what will be syntax for script to call variable from multiple files.
This: works for me, not sure if you tried this?
$ cat param.ini
Var1=today
Var3=xyz
$ cat param.override
Var1=yesterday
var2=123
$ cat test.sh
#!/usr/bin/bash
. ~/cygwin/param.override ~/cygwin/param.ini
echo "run day -> $Var1"
$ ./test.sh
run day -> yesterday

Extract info from a text file and use it in a command in unix

I am trying to extract info from a .list file called 'accounts.list'
and use the extracted info in a command line operation in CentOS 7. I know there is a simple solution but I cannot for the life of me find it.
So the file has each line listed in the following format:
John Smith | jsmith
Jane Doe | jdoe
What I need to do is add users with the information from each line. So for example I would like to add each part to a variable, and then use the variable in a adduser command:
fn=John
ln=Smith
un=jsmith
useradd -c "$fn $ln" $un
So I need to go through each line and extract that info, add the user, and then continue on to the next line. I want to do this in the simplest way possible, but nothing I've tried has worked, any help would be greatly appreciated.
while read -r fn ln ignore un; do useradd -c "$fn $ln" "$un"; done <accounts.list
Or, if you prefer commands spread over multiple lines:
while read -r fn ln ignore un
do
useradd -c "$fn $ln" "$un"
done <accounts.list
How it works
Each line of your file has four fields: the first name (fn), the last name (ln), the vertical bar, the username (un). The command read reads from the input file line-by-line and assigns these four fields to the variables fn, ln, ignore, and un.

Selecting a range of records from a file in Unix

I have 4,930,728 records on a file text file in unix. This file is used to ingest images to Oracle web center content using batchloader. <<EOD>> indicate end of record as per below sample.
I have two questions
After processing 4,300,846 of 4,930,728 record(s), the batchloader fails for whatever resoan. Now I want to create a new file with records from 4,300,846 to 4,930,728. How do I do achieve that?
I want to split this text file containing 4930728 records into multiple files each contaiting range of (1,000,000) records e.g. file 1 contains records from 0 to 10,000,000. The second file contains records from 1,000,001 to 20,000,000 and so on. How do I achieve this?
filename: load_images.txt
Action = insert
DirectReleaseNewCheckinDoc=1
dUser=Biometric
dDocTitle=333_33336145454_RT.wsq
dDocType=Document
dDocAuthor=Biometric
dSecurityGroup=Biometric
dDocAccount=Biometric
xCUSTOMER_MSISDN=33333
xPIN_REF=64343439
doFileCopy=1
fParentGUID=2CBC11DF728D39AEF91734C58AE5E4A5
fApplication=framework
primaryFile=647229_234343145454_RT.wsq
primaryFile:path=/ecmmigration_new/3339_2347333145454_RT.wsq
xComments=Biometric Migration from table OWCWEWW_MIG_3007
<<EOD>>
Answer #1:
head -n 4930728 myfile.txt | tail -n $(echo "4930728 - 4300846" | bc)
Answer #2 - to split the files in 1000 0000 lines:
split -l 10000000 myfile.txt ### It will create file like xaa,xab and so on

Which file contains asterisk in unix

All
Here i post my doubt about files with asterisk, First i create one file
touch test*
If i check ls -lrt it shows the test* file in the current.
Then i removed that file using rm *.
Then i create two files which are test1* test2* using same touch command.
If i check ls -lrt.
It displays the two files that are test1* and test2*.
Again i create test* using touch command , now i check ls -lrt.
This time it will not display the file test*.
Why the test* file is not listed ?
Thanks & regards
As * is used by your shell as universal character, when you write
touch test*
your shell will tranform it into
touch test1* test2*
If you want to create 'test*', use simple quote, which inhibit the globing function.
touch 'test*'
Normally touch command is used to create a empty file.
if file is already there it will change only the access time.
first time you are using the touch test*
that there is no test file so it will creates file names as test*
second time you are using touch test* that, time the current directory having test1* and test2* files,
so it will expand into test1* and test2* .
In that case it will change only the access time of the both file.
if you want to create one more time test* file means you can use double quotes.

Resources