10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Seeking for your assistance on how to append the specific string when $3 condion met.
ex. file1.txt
ar0050046b16,5,888,0,0,0,0.00,0.00,0.00,0.00,25689.55
ar0050046b16,5,0,0,0,0,0.00,0.00,0.00,0.00,25689.55
ar0050046b16,5,0,0,0,0,0.00,0.00,0.00,0.00,25689.55
expected output:... (5 Replies)
Discussion started by: znesotomayor
5 Replies
2. Shell Programming and Scripting
Hello,
I'd like to write a monthly archive script that archives some logs. But I'd like to do it based on yesterday's date. In other words, I'd like to schedule the script to run on the 1st day of each month, but have the archive filename include the previous month instead.
Here's what I... (5 Replies)
Discussion started by: nbsparks
5 Replies
3. Shell Programming and Scripting
Hi,
i wrote the script like...
v_date=`date "+%Y%m%d"`;
v_date1="rejects_"$v_date'.txt';
echo $v_date1;
awk -F\| 'NF==4{ print $0>$v_date1;next} NF!=4 {print $0 >"murali.txt";next}' test1.txt
while append data into file as coming like file is $v_date1,but i want data into file... (4 Replies)
Discussion started by: bmk
4 Replies
4. Shell Programming and Scripting
Assume I have 2 gz files with 2 lines each as below
a.gz
a1,a
a2,a
b.gz
b1,b
b2,b
If I issue
gzip -d -c *.gz
I will get below in the stdout
a1,a
a2,a
b1,b
b2,b
What I need it the filename appended to each row either at the front or back.
a.gz,a1,a
a.gz,a2,a (2 Replies)
Discussion started by: ericlim
2 Replies
5. Shell Programming and Scripting
Hi,
There are similar kind of posts, but none seems like working for me. Please correct me if I'm wrong.
I need append/rename file abc.txt with file processed date and time like abc_systemdatetimestamp.txt
and move it to different folder.
for example I have
/source/data/abc.txt
... (1 Reply)
Discussion started by: amsn08
1 Replies
6. Shell Programming and Scripting
i would like to know how to append current date in a filename with .tgz extension.
#!/usr/bin/perl
my $date = `date + %Y%m%d`;
system("sudo mv /tmp/nyucs01_config_backup.tgz /misc/nyucs01_config_backup_$date.tgz");
im getting this error message:
sh: line 1: .tgz: command not found (7 Replies)
Discussion started by: linuxgeek
7 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I need to create a shell script that appends a filename to create a name with the date and time appended that is guaranteed to not exist. That is, the script insures you will not overwrite a file with the same name. I am lost with this one. I know I need to use date but after that I am... (3 Replies)
Discussion started by: citizencro
3 Replies
8. UNIX for Dummies Questions & Answers
I need to append previous days date to my file which is generated using a script. I am working on Solaris 10. Thanks! (2 Replies)
Discussion started by: Twisha
2 Replies
9. UNIX for Dummies Questions & Answers
I am working on an shell script which checks for all the file starting with abc*.*
and if file found then the filelines need to append the file name in begining
can some one help with the filename appending...
for i in `ls $filename*.csv`
do
echo $i
--- NEED to append file name befor... (3 Replies)
Discussion started by: Satyagiri
3 Replies
10. UNIX for Dummies Questions & Answers
In C Shell programming I haven't successfully been able to append the date in the format mmddyyyy to a filename. I've tried the following:
I can print out the date in the correct format: date +%x | sed ‘s/\///g
I can create a variable with the filename: set newfile=changedfiles
I can... (3 Replies)
Discussion started by: gigigi
3 Replies