Sponsored Content
Top Forums Shell Programming and Scripting Trouble with simple cutting, joining Post 302966486 by htzdruk on Friday 12th of February 2016 03:29:18 PM
Old 02-12-2016
Trouble with simple cutting, joining

Made a file called assignment1.sh and this is what's inside -
Code:
#!/bin/bash
$ cut -c 2 sales.txt > regionalsales.txt
$ cut -c 6 sales.txt > regionalsales.txt
$ cut -c 1 territory.txt > terrsummary.txt
$ cut -c 2 territory.txt > terrsummary.txt
$ cut -c 3 territory.txt > terrsummary.txt
$ sort -n 4 names.txt > sortnames.txt
$ sort -n 1 regionalsales.txt > sortsales.txt
$ sort -n 1 terrsummary.txt > sortsummary.txt
$ join sortsales.txt sortsummary.txt > allsales.txt
$ join allsales.txt sortnames.txt > finalfile.txt

I have a file named sales.txt, territory.txt and names.txt. The others are to be created. I'm getting this when I run in terminal -

Code:
[dylanrukav@localhost Assignment1]$ '/home/dylanrukav/Desktop/Assignment1/assignment1' 
/home/dylanrukav/Desktop/Assignment1/assignment1: line 2: $: command not found
/home/dylanrukav/Desktop/Assignment1/assignment1: line 3: $: command not found
/home/dylanrukav/Desktop/Assignment1/assignment1: line 4: $: command not found
/home/dylanrukav/Desktop/Assignment1/assignment1: line 5: $: command not found
/home/dylanrukav/Desktop/Assignment1/assignment1: line 6: $: command not found
/home/dylanrukav/Desktop/Assignment1/assignment1: line 7: $: command not found
/home/dylanrukav/Desktop/Assignment1/assignment1: line 8: $: command not found
/home/dylanrukav/Desktop/Assignment1/assignment1: line 9: $: command not found
/home/dylanrukav/Desktop/Assignment1/assignment1: line 10: $: command not found
/home/dylanrukav/Desktop/Assignment1/assignment1: line 11: $: command not found
[dylanrukav@localhost Assignment1]$

Any ideas?

Edit - I'm using CentOS with GNOME desktop.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cutting out the last field

Hi all; i was asked to install an inventory tool on our Reliant Unix 5.45 server. I downloaded the file from our intratnet. It was always failing when i try to install it. After some investigation i saw that the installation script had something strange. When i "cat <script>" i see nothing... (2 Replies)
Discussion started by: bcheaib
2 Replies

2. UNIX for Dummies Questions & Answers

cutting

Is there any cut or awk function that would allow me to take the last part of a path away and save the list into a file? I wrote: find $HOME -mtime +3 > fileList cat fileList /home/102/s/jn/folder/HW /home/102/s/jn/otherfolder/B.txt /home/102/s/jn/folder4/3dA/w... (1 Reply)
Discussion started by: terms5
1 Replies

3. Shell Programming and Scripting

problem cutting

echo $line|cut -d " " -f`$plannedCount`- and this is the output $ ./read.sh ./read.sh: 12: not found JADE TRADER 143W MYPEN 40 HC M X10 28 7 1 0 ./read.sh: 9: not found MYPEN 20 GP X X10 15 2 1 0 ./read.sh: 9: not found MYPEN 40 GP X X10 28 7 1 0 ./read.sh: 9: not found MYPEN 20... (6 Replies)
Discussion started by: finalight
6 Replies

4. Shell Programming and Scripting

cutting lines

Dear All, Is there a way to cut the lines that have been "head" Here is what i m trying to do Please advice there is file name dummy.txt now i am trying to head this file 4 time by using a loop and every time this file is head with different values e.g in first instance it will... (7 Replies)
Discussion started by: jojo123
7 Replies

5. Shell Programming and Scripting

Trouble cutting characters into a string.

I just have a couple of quick questions. I am having trouble with this cut. I am basically trying to cut the string so that i can insert the users guess at the appropriate point in the string. $letters is the character count of the $word. What it seems to do is cut the character into the... (0 Replies)
Discussion started by: Makaer
0 Replies

6. Shell Programming and Scripting

Cutting the value from a string

Hi all I have a string variable ${WHERE_SQL1} where i want to cut the first value of a variable. Eg ${WHERE_SQL1} = 'Where a.id =.................' I the string to be 'a.id =.......' Thanks in advance (2 Replies)
Discussion started by: theeights
2 Replies

7. UNIX for Dummies Questions & Answers

any script for joining files based on simple conditions

Condition1; If NPID and IndID of both input1 and input2 are same take all the vaues relevant to them and print together as output Condition2; IDNo in output: Take the highly repeated same letter of similar NPID-IndID as *1* Second highly repeated same letter... (0 Replies)
Discussion started by: stateperl
0 Replies

8. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

9. Red Hat

Syslog.conf: looking for a simple answer on a simple question

Cheers! In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not? To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies

10. UNIX for Dummies Questions & Answers

[Solved] Having trouble with simple grep search

I have a text file (allWords.txt), that I would like to search through. Here is a snippet of what it looks like... a aah aahed aahing aahs aardvark aardvarks aardwolf ab abaci aback abacus abacuses abaft ...... I would like to use the grep search to search, line by line, for... (8 Replies)
Discussion started by: blackvelvet
8 Replies
PARALLEL-SLURP(1)														 PARALLEL-SLURP(1)

NAME
parallel-slurp - copy files from listed hosts SYNOPSIS
parallel-slurp [OPTIONS] -h hosts.txt -L destdir remote local DESCRIPTION
pssh provides a number of commands for executing against a group of computers, using SSH. It's most useful for operating on clusters of homogenously-configured hosts. parallel-slurp gathers specified files from hosts you listed. OPTIONS
-r --recursive recusively copy directories (OPTIONAL) -L --localdir output directory for remote file copies -h --hosts hosts file (each line "host[:port] [user]") -l --user username (OPTIONAL) -p --par max number of parallel threads (OPTIONAL) -o --outdir output directory for stdout files (OPTIONAL) -e --errdir output directory for stderr files (OPTIONAL) -t --timeout timeout (secs) (-1 = no timeout) per host (OPTIONAL) -O --options SSH options (OPTIONAL) -v --verbose turn on warning and diagnostic messages (OPTIONAL) EXAMPLE
An example to copy /home/irb2/foo.txt from each host. Files gathered will be stored in /tmp/outdir/hostname/foo.txt. # prallel-slurp -h hosts.txt -L /tmp/outdir -l irb2 /home/irb2/foo.txt foo.txt ENVIRONMENT
All four programs take similar sets of options. All of these options can be set using the following environment variables: o PSSH_HOSTS o PSSH_USER o PSSH_PAR o PSSH_OUTDIR o PSSH_VERBOSE o PSSH_OPTIONS SEE ALSO
parallel-ssh(1), parallel-scp(1), parallel-nuke(1), parallel-rsync(1), ssh(1) AUTHOR
Brent N. Chun <bnc@theether.org> COPYING
Copyright: 2003, 2004, 2005, 2006, 2007 Brent N. Chun NOTES
1. bnc@theether.org mailto:bnc@theether.org 03/30/2009 PARALLEL-SLURP(1)
All times are GMT -4. The time now is 09:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy