10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
the first line of every unix script written in an interpreted language always has a "#!<path-to-the-language>"
is there a way to include other text in that first line without it affecting the ability of the script to run???
for instance, if i change the following line:
#!/bin/sh
echo blah... (1 Reply)
Discussion started by: SkySmart
1 Replies
2. Shell Programming and Scripting
Hi,
I am doing something like below:
cat file1>file3and
cat file2>>file3
I wanted to check if there is a way to write a custom message(hardcoded message)something like below at the beginning of each line then PIPE delimitiation and then followed by remaining record.
cat file1... (7 Replies)
Discussion started by: Saanvi1
7 Replies
3. UNIX for Dummies Questions & Answers
Hey guys,
I need to write a script that will add a specific text at the end of a specific line (of a text file). but the line is a variable
this is my text file :
device_2 ansible_ssh_host=127.0.0.1 ansible_ssh_port=30000 ansible_ssh_user='root'
device_2 ansible_ssh_host=127.0.0.1... (1 Reply)
Discussion started by: OdedOvdat
1 Replies
4. Shell Programming and Scripting
Hi all,
I have 20 files (file001.txt upto file020.txt) and I want to read them from 3rd line upto end of file (line 1002). But in the final file they should appear to start from line 1.
I need following kind of output in a single file:
Filename Line number 2ndcolumn 4thcolumn
I... (14 Replies)
Discussion started by: bioinfo
14 Replies
5. Shell Programming and Scripting
Hello
I need to add a String after a text in a line. The Unix file is huge and I think nawk would be quick.
Current:
-name FILTER -node 60265 -cob 31/01/2013 -risktype + -change 1 -filter ALL_NODES -toponly -warnings OFF -delimiter "|" -noheader -select... (4 Replies)
Discussion started by: filter
4 Replies
6. Shell Programming and Scripting
I have a tab delimited text file,
id name distance
1 3325167 0.334561754018
2 3290488 0.389444269458
3 3288794 0.392312701782
4 3347602 0.392532202097
5 3295355 0.394394169485
I need to add a line after the header line. The first and third field of... (3 Replies)
Discussion started by: LMHmedchem
3 Replies
7. Shell Programming and Scripting
hello i need some help here are the contents of my file.
test.txt
this is filename 1.mp3 http://www.url.com/filenamehashed
filename 2.mp3 http://www.url.com/fileamehashed
something_else.zip http://www.url.com/filenamehashed
so this file has 100 of these lines
filename url
I would... (9 Replies)
Discussion started by: mscice
9 Replies
8. Shell Programming and Scripting
Hi,
I wanted to add specific text to each row in a text file containing three rows. Example:
0 8 7 6 5 5
7 8 9 0 7 9
7 8 9 0 1 2
And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this:
21 0 8 7 6 5 5
7 8... (4 Replies)
Discussion started by: hertingm
4 Replies
9. Shell Programming and Scripting
I'm needing to add a "hour:min" to the end of each line in a document. The document in this case is only going to be one line.
if this inserts it at the end, what needs to be changed to add something at the end...
/bin/echo "%s/^/$filler/g\nwq!" | ex -s $oFile
Thank you... (2 Replies)
Discussion started by: cubs0729
2 Replies
10. Shell Programming and Scripting
How would I add text to the beginning of each line in a text file in a script right after the file is created from another text file. (4 Replies)
Discussion started by: cubs0729
4 Replies