10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi ,
Please help me out for the below problem -
I have 2 files in a directory -
$ ls -ltr
total 4
-rwx------+ 1 abc Domain Users 615 May 31 17:33 abc.txt
-rwx------+ 1 abc Domain Users 0 May 31 17:33 ll.sh
I want to write the filename of abc.txt along with the directory to the... (2 Replies)
Discussion started by: Pratik4891
2 Replies
2. UNIX for Dummies Questions & Answers
Hi Guys,
I have serveral directories like this:
(2013) blablabla(blabla) - blabla (blabla)
or
(1997) blablabla(blabla) - blabla (blabla)
and have to rename them to something like that:
blablabla(blabla) - blabla (blabla) (2013)
and
blablabla(blabla) - blabla (blabla) (1997)
Easy... (2 Replies)
Discussion started by: Nateshift
2 Replies
3. UNIX for Dummies Questions & Answers
Hi there
/root #yum localinstall sg3_utils
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Local Package Process
Skipping: sg3_utils, filename does not end in .rpm.
Nothing to do
/root #
above is the error
/root... (6 Replies)
Discussion started by: heman96
6 Replies
4. Shell Programming and Scripting
Hi all.. I have several unique files that contain one thing in common, and that is acct#. For all files in the directory, I want to append the 10 characters following the word "ACCOUNT:" to the end of the filename.
for example:
I have file 111_123 that contains ACCOUNT:ABC1234567
The file... (5 Replies)
Discussion started by: cinderella1
5 Replies
5. UNIX for Dummies Questions & Answers
Have you seen this before on Solari?
Create file -> chmod file-> file gets a * at the end of filename
Ex1)
gate@server1# ll
total 8
drwxr-xr-x 2 stdbgate dba 512 Jan 18 14:30 ./
drwxr-xr-x 3 stdbgate dba 512 Jan 18 14:18 ../
-rw-r--r-- 1 stdbgate dba ... (3 Replies)
Discussion started by: drbiloukos
3 Replies
6. Shell Programming and Scripting
Hi all,
I have this basic script to remove, in this case 9 characters from the end of a file name. This is what I have so far,
for file in *.mov
do
newname=`echo $file | sed 's/\(.*\)........./\1/' `
mv "$file" "$newname"
done
The problem is that it removes the file extension as well.... (2 Replies)
Discussion started by: Monkey Dean
2 Replies
7. Shell Programming and Scripting
Hi all,
I am trying to write a script that will delete a certain amount of text from the end of a filename.
For example.
Input:
name of file (more text).pdf
Output:
name of file.pdf
So is it possible to write a script the deletes, in this example twelve (12) digits from the end... (6 Replies)
Discussion started by: Monkey Dean
6 Replies
8. Shell Programming and Scripting
Hi All,
I have named a file with current date,time and year as follows:
month=`date | awk '{print $2}'`
date=`date | awk '{print $3}'`
year=`date | awk '{print $6}'`
time=`date +%Hh_%Mm_%Ss'`
filename="test_"$month"_"$date"_"$year"_"$time".txt"
> $filename
The file is created with a... (2 Replies)
Discussion started by: amio
2 Replies
9. Shell Programming and Scripting
Hi,
I'm reading data from comma separated files to DB. Now there is a need to have the name of the input file in each row of that file. How can I do this in unix script?
Example:
$cat file1
value11,value12, value,13
value21,value22, value,23
value31,value32, value,33
And the result... (2 Replies)
Discussion started by: tmikahan
2 Replies
10. Shell Programming and Scripting
Hi,
I have 24 .dat files something like below. The file name starts with “abc” followed by two digit month and two digit year. Is there a way to grab the month and year from each filename and append it to the end of each line. Once this is done I want to combine all the files into file... (1 Reply)
Discussion started by: rkumar28
1 Replies