10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a tab separated. I want to replace all the "&" in 8th column of the file with "and" .I am trying with
awk -F, -vOFS=\\t '{$8=($8=="&")?"and":$8}1' test> test1.txt
My file is abc def ghk hjk lkm hgb jkluy acvf & bhj hihuhu fgg
me mine he her go went has has & had hgf hgy
... (1 Reply)
Discussion started by: jagdishrout
1 Replies
2. Shell Programming and Scripting
Hi
I want to store the file names into an array.
I have written like this but I am getting error.
declare -A arr_Filenames
ls -l *.log | set -A arr_Filenames $(awk '{print $9}')
index=0
while (( $index < ${#arr_Filenames
})); do
Current_Filename=${arr_Filenames}
... (5 Replies)
Discussion started by: dgmm
5 Replies
3. Shell Programming and Scripting
Hi,
I am trying to do the following thing
var='date'
$var
Above command substitutes date for and in turn runs the date command and i am getting the todays date value.
I am trying to do the same thing as following, but facing some problems,
unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies
4. Shell Programming and Scripting
Hi,
I need to parse a simple text file like below and store the word that starts with BR* to a variable say $BRno. I need to do this in sh script.
NOTE: the length of the numbers following BR is in constant. And there is only 1 BRXXX in a file at a given time.
.txt file:
BR276828... (1 Reply)
Discussion started by: script2010
1 Replies
5. Shell Programming and Scripting
Hello friends, I need ur help.I want to write a script. The script should read contents from a file namely xyz. e.g xyz abcd,1234,efgh,7854378 dhnsa,dsakjkdl,43432,ZXDsa the script should store comma (,) seperated values in different variables. Once pointer will reach end of line (\n), it should... (1 Reply)
Discussion started by: akhtar.bhat
1 Replies
6. Shell Programming and Scripting
Small query-
I want to do some operation on all the files older then today. Before I do that operation, i want to verify if the command works properly or not.
Surprisingly, the command below returns me file, which are created today -
find /mrk_archive/PG/ftp/incomming/gbs/2008 -type f... (2 Replies)
Discussion started by: kedar.mehta
2 Replies
7. Shell Programming and Scripting
Hi,
When we use "ls -l" we are getting like below,
-rw-r--r-- 1 mdskl mds 4161479 Apr 12 14:57 VTTF2008.20080412145748.cc
But i need only modified time and filename only like below,
Apr 12 14:57 VTTF3008.20080412145748.cc
Thanks-:)
Senthil (4 Replies)
Discussion started by: senthil_seera
4 Replies
8. UNIX for Advanced & Expert Users
Hi,
I am currently using the following command:
files=(ls enuCPU??.????.exp ntuCPU??.????.exp)
I need to now change the commmand to store the file names of files that have been modified before datetime equal to say '02/16/2008 20:30:00'
What could I use? (2 Replies)
Discussion started by: edisonantus
2 Replies
9. Shell Programming and Scripting
Hello people,
I want to list the files & folders created/modified since a particular date say June 2006. I know I can list recursively thru the folders and use awk to extract the date column to get the desired output.
Just wanted to check whether there is an easier way to do this. Please... (2 Replies)
Discussion started by: tipsy
2 Replies
10. Shell Programming and Scripting
Hi All,
My script has to find todays modified( less than 24 hrs) files & send it another server using SCP.
what I wrote is
find . -type f -mtime -1 | xargs ls -ltr ## to find today's files, but its giving my sh_history file also, I don't require this file at all.
scp... (4 Replies)
Discussion started by: zinu
4 Replies