10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a directory containing multiple files.
and also a txt file which contains the list of all filenames and certain values.
I want to read the text file line by line and if its 2nd column is matched with the filename in directory, then it must insert the values in 7th column to... (14 Replies)
Discussion started by: CAch
14 Replies
2. Shell Programming and Scripting
Hi ,
Am trying to gunzip a file and pass the gunzipped file name to a variable , but its not taking up the value. Am trying to execute the command f=`gunzip <filename>`;echo $f. Here the file is getting gunzipped but the file name is not assigned to the variable. Any help on this will be useful.... (5 Replies)
Discussion started by: rogerben
5 Replies
3. Shell Programming and Scripting
Hi guys,
I have a variable where i am storing the filename (with full path).
I just need the value before ".txt". But instead of getting the filename i am getting the contents of the filename.
FileName=/appl/data/Input/US/Test.txt
a=`awk -F"." '{print $1}' ${FileName}`
echo $a... (3 Replies)
Discussion started by: mac4rfree
3 Replies
4. Shell Programming and Scripting
Hi all,
I want to set the last 4 letter in the filename as a variable.
For example, i have AB1234.txt file and i need to have last 4 letter as a variable.
It should be like ;
get last four letter
set var = 1234
How can i write this in C shell??
Thanks,
zibi (3 Replies)
Discussion started by: zibi
3 Replies
5. Shell Programming and Scripting
Greetings, people of UNIX/Linux forums.
I am having a problem with a script, where I am trying to create a new variable. The value of this variable would be dependent on the value in a couple other previous variables (all variables are 2-digit integers). Here is my code:
#set the stations... (3 Replies)
Discussion started by: TheSMan5
3 Replies
6. UNIX for Dummies Questions & Answers
Im trying to set a filename to a variable and then read the file in using the variable but im getting a syntax error. any ideas?
#!/bin/bash
function scanFile()
{
while read $1
do
echo $filename
done
}
file1=report.log
scanFile() $file1 (3 Replies)
Discussion started by: magnia
3 Replies
7. UNIX for Dummies Questions & Answers
Hi all,
I have a scenario as below. I created a file -
$touch myfile.onlytesting.20090227.txt
I want to assign the date only - 20090227 into a variable x.
How do I do this in unix command?
Please help. Thanks;) (4 Replies)
Discussion started by: luna_soleil
4 Replies
8. Shell Programming and Scripting
Hi,
In the code below, the $DD1, $DD2, $MM1, $MM2 are not fetching the values. Can anybody tell me where have i made wrong.
Shift_date.sh is a script which gives the previous date if we give the current date in the format YYYYMMDD and +/- how many days past/future.. Like Shift_date.sh... (3 Replies)
Discussion started by: RRVARMA
3 Replies
9. Shell Programming and Scripting
Anyone who can assist :
I am trying to pass the group vairiable to a filename:
rpt_tsavegrp=/export/legato/scripts/$group_savegrp_rpt.$dat
It will not pass to variable.
Anyone have any ideas what I am doing wrong here.
Thanks
# This script sends email that save group completed.... (3 Replies)
Discussion started by: gzs553
3 Replies
10. UNIX for Dummies Questions & Answers
Need some help.
I need to load data into some Oracle tables and one of the pieces of data that I need to load is the filename. This filename is distinct every single time. Basically the last 6 characters will be different with no pattern.
ex. testfile_041504_003567
To load the filename... (4 Replies)
Discussion started by: firkus
4 Replies