10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I tried different solutions given in various linux portals but no luck..
The directory consists of files with no-extension.
Each file has only one line. I need to add each filename to the top of each file so eventually each file will have two rows.
Filenames have spaces between words... (6 Replies)
Discussion started by: baris35
6 Replies
2. Shell Programming and Scripting
Hi,
Please excuse for posting new thread on control characters,
I am facing some difficulties in removing the control character from a file extracted from top command,
i am able to see control characters using more command and in vi mode, through cat control characters are not visible ... (8 Replies)
Discussion started by: karthikram
8 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I am using below in my .bashrc to dynamically display user/host/directory information whenever i logged in to my Red hat Linux 64bit OS, BASH shell.
export PS1='$PWD>'
output:
/dbms/app/oracle/product/11.2.0/dbhome_1>
But i want to display absolute path information to be displayed... (1 Reply)
Discussion started by: Ariean
1 Replies
4. Shell Programming and Scripting
Hi All,
I have a directory like this: /u01/app/oracle/11gSE1/11gR203
How do i get the top level directory /u01 from this? Tried dirname and basename but dint help. I can this using echo $ORACLE_HOME | awk -F"/" '{print "/"$2}'. But I am trying to find out if there is a better way of doing it... (4 Replies)
Discussion started by: nilayasundar
4 Replies
5. Shell Programming and Scripting
I am trying to add a single line of text to every file in a particular folder. There are thousands of files in the folder.
Each file contains this same start of the first line:
{d "%w- %d %m-, %Y - %T"} <some message here>
with the rest of the text following the second curly bracket... (10 Replies)
Discussion started by: dlundwall
10 Replies
6. Shell Programming and Scripting
I am trying to display the output of ls and also print the number of characters in EVERY file name. This is what I have so far:
#!/bin/sh
for x in `ls`; do
echo The number of characters in x | wc -m
done
Any help appreciated (1 Reply)
Discussion started by: LinuxNubBrah
1 Replies
7. Shell Programming and Scripting
Hi Forum.
I'm struggling on this relatively easy request to add additional 4 0's to an existing text in a file (whenever I see the pattern -# where # represents any number) using sed command while preserving the rest of the text in the files.
Original Text:
$DBConnection_EDW=SAS2EDW... (5 Replies)
Discussion started by: pchang
5 Replies
8. Shell Programming and Scripting
If I had a word list with a large amount of words in it, how would I (using a unix command) add, say, 123 to the end of each word?
EDIT: The word list is stored in a large text file. I need a command that applies the ending to each word in the file and saves the result in a new text file. (7 Replies)
Discussion started by: evillion
7 Replies
9. Shell Programming and Scripting
Hi
I have an AWK script that takes an input file and outputs it as CSV format.
The problem is its also outputting the characters at the top which are dashes(-------) and i want it to leave them out.
My script is as follows.
BEGIN {
count=1;
}
/^/ {
count+=1
if ( count > 2 ){... (3 Replies)
Discussion started by: magikminox
3 Replies
10. UNIX for Dummies Questions & Answers
Hi this is quite simple i am sure but without using awk or sed i need to add text to the top of a file this is what i have got so far
#!bin/bash
echo "Add text to top of file"
read line
echo $line >> file1
This adds the text to the bottom of the file can some1 please help cheers (7 Replies)
Discussion started by: meadhere
7 Replies