Search Results

Search: Posts Made By: aks_1902
Forum: Solaris 02-09-2018
1,608
Posted By Corona688
Getting what error?
Getting what error?
15,335
Posted By ahamed101
Try this to get the concept... [root@bt] $...
Try this to get the concept...

[root@bt] $ cat run
#!/bin/bash

set -- "1" "2" "3" "4" "5"
echo $*
shift
echo $*
shift
echo $*
shift
echo $*
Output

[root@bt] $ ./run
1 2 3 4 5
2 3...
974
Posted By ahamed101
When you say the files are getting created...
When you say the files are getting created monthly basis, does it mean that each file created every month? or all of them created at once one for each month?

--ahamed
974
Posted By ahamed101
If the files maintain the timestamp then try...
If the files maintain the timestamp then try this...
ls -t Test_Directory/FILE* | tail -1 | xargs -I {} mv {} /your/destination
--ahamed
974
Posted By jayan_jay
Instead of copying and removing .. just move ...
Instead of copying and removing .. just move the file to the destination path ..

$ ls File* | sort -n | nawk '{if(NR==1) {print "mv "$0" /dest/path"}}' | sh
4,052
Posted By ahamed101
Try this... #!/bin/bash day=$(date +%d) ...
Try this...
#!/bin/bash
day=$(date +%d)
month=$(date +%m)
year=$(date +%Y)
run_or_not=$( awk -v day=$day -v month=$month -v year=$year 'BEGIN {
if(month%2 && day == 30){ print "run"...
1,666
Posted By hergp
Assuming the modification time of the directories...
Assuming the modification time of the directories is reliable to sort out the latest:

set -- $(ls -t)
shift
rm -r $*
If the "latest" directory is last in the sorted output of directory names,...
8,077
Posted By zaxxon
You could have a script in crontab, that just...
You could have a script in crontab, that just does the following:

L=$(cal| awk 'END {print $NF}')

Then compare the actual day with $L and decide to run your job or not.
It will run every day...
8,077
Posted By jayan_jay
https://www.unix.com/shell-programming-scripting/19...
https://www.unix.com/shell-programming-scripting/19318-crontab-entry-run-every-last-day-month.html
1,797
Posted By Scott
What your awk is doing doesn't seem to fully...
What your awk is doing doesn't seem to fully match what your input file looks like (i.e. you're using | as a field separator, when the path is / separated, there is nothing ending with ".atr" - since...
1,181
Posted By zaxxon
mkdir "$(echo...
mkdir "$(echo "/user/Oracle/my_catalog/default/root/webcat+backup+testing+07192011.atr" |\
awk -F\| '{gsub(/(+)/," ",$NF);gsub(/\.atr$/,""); print}')"
1,181
Posted By itkamaraj
file_path="...
file_path=" /user/Oracle/my_catalog/default/root/webcat+backup+testing+07192011.atr"
dir_name=`echo $file_path | awk -F"[.+]" '{print $NF-1}`
mkdir $dir_name
1,421
Posted By radoulov
I suppose you need something like this: ...
I suppose you need something like this:

while read eachline
do

VAL=$(
printf '%s\n' "$eachline" |
sed -e 's/[^/]*$//' -e 's/default/default_new/'
)

cp -r --...
1,137
Posted By 116@434
Try this: echo $eachline | dirname |...
Try this:


echo $eachline | dirname | sed 's:/backup/:/backup_path/:'
1,137
Posted By itkamaraj
sed 's/[^/]*$//' -e 's/backup/backup_new/'...
sed 's/[^/]*$//' -e 's/backup/backup_new/' filename
1,670
Posted By zaxxon
$>...
$> VAR=user/oracle/Test_admin/myfolder/bakup/part_bkptemp_part_bkp_repeated/list.txt
$> echo ${VAR%/*}"/"
user/oracle/Test_admin/myfolder/bakup/part_bkptemp_part_bkp_repeated/

or

$>...
1,670
Posted By itkamaraj
dirname $ dirname "a/b/c.txt" ...
dirname



$ dirname "a/b/c.txt"
a/b
14,094
Posted By bartus11
awk -F"/" '{print $(NF-1)}' file
awk -F"/" '{print $(NF-1)}' file
13,828
Posted By itkamaraj
$nawk -F"\/" '{print $NF}' test adhoc new ...
$nawk -F"\/" '{print $NF}' test
adhoc
new
test



---------- Post updated at 02:43 PM ---------- Previous update was at 02:42 PM ----------


$while read line; do basename $line; done <...
13,828
Posted By gowtham.varma
if the format of the lines does not change this...
if the format of the lines does not change this may help you..
name=`cat <filename> | awk -F '/' '{ print $7}'`
echo $name

or else to print the last word try this
name=`cat <file name> | awk...
13,828
Posted By guruprasadpr
Hi Just a backslash missing in your original...
Hi
Just a backslash missing in your original sed:

sed 's/.*\/\(.*\)/\1/' list.txt

Guru.
1,021
Posted By Skrynesaver
You could perform a check to see if the file...
You could perform a check to see if the file exists


while [ -x /usr/x/x/x/temp_part_bkp/$Eachline ] ; do
$Eachline="$Eachline.1"
done;
Showing results 1 to 22 of 22

 
All times are GMT -4. The time now is 11:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy