Would pipe work better with this command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Would pipe work better with this command
# 8  
Old 03-12-2014
Thats good to know because I don't really need to save these files I would just like to run them
if i use the command
Code:
tr -d '\r' < inputfile | >

should that work?
# 9  
Old 03-12-2014
Oh, you want to run the file directly after doing it?

You use the bash or sh command for that.

Code:
tr -d '\r' < windowstext | bash -s

Of course, it would be better to not edit your scripts in microsoft notepad. Editing your UNIX scripts in UNIX with a UNIX editor would avoid the non-UNIX carriage returns...
# 10  
Old 03-12-2014
when I try to run the preceding command I get the following error
Code:
/Volumes/AraxiVolume_HW07376_J-1/OPS_OutPuts_TimeStampText_For_Naming_Work_Folder/OPS_TempFolderForFiringTrigger/GOLDEN.TERM: line 1: `tr -d '\r' < /Volumes/AraxiVolume_HW07376_J-1/OPS_OutPuts_TimeStampText_For_Naming_Work_Folder/OPS_OutPuts_TimeStamp_SED_INPUT/[0-9]*-OPS_OutPuts_TimeStamp | >'
/Volumes/AraxiVolume_HW07376_J-1/OPS_OutPuts_TimeStampText_For_Naming_Work_Folder/OPS_TempFolderForFiringTrigger/GOLDEN.TERM: line 1: syntax error near unexpected token `newline'

do you know what it is i am doing wrong I am invoking this comnd through a text file
# 11  
Old 03-12-2014
windowstext is a filename.
# 12  
Old 03-12-2014
Thanks you very much for everyone on this board fot all your help with this project I have the files working the way they should now all your patience is very much appreciated
You guys are so awesome!
# 13  
Old 03-16-2014
Hi I am trying to use this command inside a shell script that the to copy 3 files files to another directory

Code:
for i in ${/Volumes/AraxiVolume_HW07376_J/Jobs/OPS_IMPO_18x18_1-side/UserDefinedFolders/OPS_IMPO_18x18_1-Sided_Check}/*; do
  [ $((N--)) = 0 ] && break
  cp -t "${/Volumes/AraxiVolume_HW07376_J/Jobs/OPS_IMPO_18x18_1-side/UserDefinedFolders/OPS_IMPO_18x18_1-Sided_PreInput}" -- "$i"
done

I keep getting this error:
Code:
/Volumes/AraxiVolume_HW07376_J/Jobs/OPS_IMPO_18x18_1-side/UserDefinedFolders/moveit.TERM: line 5: ${/Volumes/AraxiVolume_HW07376_J/Jobs/OPS_IMPO_18x18_1-side/UserDefinedFolders/OPS_IMPO_18x18_1-Sided_Check}/*: bad substitution

---------- Post updated at 05:20 PM ---------- Previous update was at 05:06 PM ----------

Hi I am trying to use this command inside a shell script to copy the first 3 files from a directory that contains many
Code:
N=3;
for i in ${/Volumes/AraxiVolume_HW07376_J/Jobs/OPS_IMPO_18x18_1-side/UserDefinedFolders/OPS_IMPO_18x18_1-Sided_Check}/*; do
  [ $((N--)) = 0 ] && break
  cp -t "${/Volumes/AraxiVolume_HW07376_J/Jobs/OPS_IMPO_18x18_1-side/UserDefinedFolders/OPS_IMPO_18x18_1-Sided_PreInput}" -- "$i"
done

I keep getting this error
Code:
/Volumes/AraxiVolume_HW07376_J/Jobs/OPS_IMPO_18x18_1-side/UserDefinedFolders/moveit.TERM: line 5: ${/Volumes/AraxiVolume_HW07376_J/Jobs/OPS_IMPO_18x18_1-side/UserDefinedFolders/OPS_IMPO_18x18_1-Sided_Check}/*: bad substitution

Can any one tell me what I'm doing wrong?
Thanks again

ps. I accidentally posted this earlier by by hitting the submit button instead of preview, sorry if this caused any confusion.
# 14  
Old 03-17-2014
/Volumes/AraxiVolume_HW07376_J/Jobs/OPS_IMPO_18x18_1-side/UserDefinedFolders/OPS_IMPO_18x18_1-Sided_Check seems like an unlikely name for a variable...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why does bc work with 'here string' and not via pipe in this example?

Hi! I actually got it running, but I still would like to understand, why and how, since I am a beginner in bash scripting. I Need floating numbers and thus use bc in my bash script. Here it is: #!/bin/bash num1="10^-15" | bc -l #power function piped to bc - DOES NOT WORK echo $num1... (4 Replies)
Discussion started by: McHale
4 Replies

2. Shell Programming and Scripting

pipe in command

Hello, I try to concatenate a command to execute. Sadly it throws an error. #!/bin/bash cd / cmd="find -name *.txt | awk '{ printf "FILE: "$1; system("less "$1);}' | egrep 'FILE:|$1'" echo "1." $($cmd) echo "2." $("$cmd") echo "3." `$cmd` echo "4." `"$cmd"`1.&3. 'find: paths must... (2 Replies)
Discussion started by: daWonderer
2 Replies

3. Shell Programming and Scripting

pipe to grep doesn't work in bash script

Hi, I'm trying to write a script that checks gvfs to see if a mount exists so I can run it from network-manager's status hooks. I thought I'd pipe the output of gvfs-mount -l to grep for the particular mounts I care about. When I do this in a bash script: cmnd="gvfs-mount -l | grep -i... (4 Replies)
Discussion started by: kcstrom
4 Replies

4. Shell Programming and Scripting

awk's getline < "-" seems not work for pipe

Hi all, I have an gawk script to get user's input, So I use getline name < "-" (or getline name < "/dev/stdin") in my script They both work fine when my script deals with files. But it is broken for pipes. When I try "some command | my awk script", the variable name just gets an empty... (17 Replies)
Discussion started by: qiulang
17 Replies

5. Shell Programming and Scripting

How to Avoid intermediate files when pipe does nt work

problem with piping one output to another.Would like to avoid the intermediate file creation.The piping does nt work on places where files have been created and goes in an endless loop. sed -e "s/^\.\///g" $LINE1| sed -e "s/_\(\)/kkk\1/g" > $file1 tr -s '_' ' ' < $file1| \ sort -n -k... (1 Reply)
Discussion started by: w020637
1 Replies

6. UNIX for Dummies Questions & Answers

How does pipe work?

I am confused over piping. :confused: A | B Will A and B run at the same time? or must A finish running before B starts to run? Suppose I want to do the following: sqlplus ... | split -1000 - filename_ sqlplus will return 1million rows, I want write the output into files of 1000... (4 Replies)
Discussion started by: Leion
4 Replies

7. UNIX for Dummies Questions & Answers

How can I use pipe command ?

Hi My friends I have used this command to find files are modified within the past 24 hours and then many files are shown but I want transfer all these files to special directory by using pipe . can any one tell me what is the next step ? (11 Replies)
Discussion started by: bintaleb
11 Replies

8. Linux

By angle-brackets/"pipe" button doesn't work?

How can I configure it? I have a swedish keyboard with swedish keyboard setting. Everything works perfectly (едц) except that button. What can be wrong? /Richard ++ NOTE: It seems like the computer notices the input but that the button isn't assigned to anything (the keyboard-cursor stops).... (1 Reply)
Discussion started by: riwa
1 Replies

9. UNIX for Dummies Questions & Answers

pipe command

current dir : /home/sales ls -l abc.txt 17th aug bcd .txt 16t oct ------- ------ Total files : 100 if i want to move only those files dated 17 aug into another sub directory /home/sales/texas how do i pipe the result of 'ls' command to a 'mv' command (1 Reply)
Discussion started by: zomboo
1 Replies

10. UNIX for Advanced & Expert Users

How to pipe command

Hi All, I want to create a command that executes a text editor with the most recent file in the current current directory. So a good start to achieve this is : ls -lrt | cut -c55- | tail -1 which provides the name of the most recent file in a directory The problem is to pipe the... (4 Replies)
Discussion started by: anonymous.nico
4 Replies
Login or Register to Ask a Question