10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello.
The file /etc/fstab contains
UUID=957c3295-9944-1593-82e2-2b90dede4312 / ext4 acl,user_xattr 1 1I fill a variable
SOME_LINE=$( cat /etc/fstab | grep \/\..*ext4 )I want
PART1=>>>>>UUID=957c3295-9944-1593-82e2-2b90dede4312 / ext4 ... (2 Replies)
Discussion started by: jcdole
2 Replies
2. Shell Programming and Scripting
Hey guyz,
I have a table which shows the presence or absence of my variables (A,B,C,...) in my observations (1,2,3,...)
* A B C ...
1 1 0 1
2 1 1 0
3 1 0 0
...
I want to calculate the co-presence of my variables. to have a table shows the pairwise presence of the variables (have... (1 Reply)
Discussion started by: @man
1 Replies
3. Shell Programming and Scripting
Hi, there
I have a file with tab and space as field separator. I need to assign values to variables then work with them, line by line. The code I wrote only works when each line has only one word. It doesn't work for the current situation.
for line in `cat file.txt`; do
ID=`awk '{print... (4 Replies)
Discussion started by: cwzkevin
4 Replies
4. Shell Programming and Scripting
my command
nawk -F' ' '{for(i=1;i<=NF;i++){if ($i ~ /XX/) print i}}' TOM.bk
The output is in two lines as below
12
30
i want the output in one line with comma delimited
as below
12,30
the 23 and 79 are column numbers in one line of the file.
so i want all the two columns... (1 Reply)
Discussion started by: dealerso
1 Replies
5. Shell Programming and Scripting
Friends
I need to have a shell script which will feed variables from two different files line-by-line. For example, I have two files - permission and file_name.
Contents of permission is -
644
755
....
contents of file_name
/file1
/file2
.....
Now I want 644 permission will be... (4 Replies)
Discussion started by: atanubanerji
4 Replies
6. Shell Programming and Scripting
Hello all,
I am very new to the shell scripting and I hope someone can help me with this.
I have thousands of files with certain format of information and I need to do this for all my files.
For each file, grab the numbers in the first and second rows and place them in the position 1 and 2... (8 Replies)
Discussion started by: GoldenFire
8 Replies
7. AIX
Hi,
I have to insert a line having variables using sed. But the variables are not getting substituted within sed.
Ex:
n=2
sed $n' i\
hi' file
This works. But the below code does not work.
n=2
line=hello
sed $n' i\
$line' file
The above code inserts '$line' in the 2nd line of the... (9 Replies)
Discussion started by: sugan
9 Replies
8. Shell Programming and Scripting
Hi everyone. I realise this is probably a bit of a noob question, but I'm actually a C# developer working on a legacy system, and can't remember much unix.
I want to read from a pipe-delimeted file like formatted thusly:
idno|PRODUCT|Name|street town postcode|etc|etc|etc|etc... (4 Replies)
Discussion started by: Darkness Fish
4 Replies
9. Shell Programming and Scripting
I am using sed for a simple substitution (see command syntax below). Everything works fine except that the last line of the input file does not get written to the output file. Has anyone ever seen this and know of way to force the last line to be written?
I don't know if it's playing a part in... (3 Replies)
Discussion started by: 2reperry
3 Replies
10. Shell Programming and Scripting
Hi,
I have a file containing emails about some issues.
Using a bourne shell script, I need to extract the issue number from the URL's contained in the file (all URL's look like this : http://www.openoffice.org/issues/show_bug.cgi?id=1881) and then print out the issue number, status and... (2 Replies)
Discussion started by: Chris Jones
2 Replies