Hi again, have a script that I would like run, but before I can run it I need to strip out the windows \r end of lines.
I have put the command into a text file and set the command to run every 10 seconds the coomand I use to do this is
The command that its firing is in a text file called GOLDEN.TERM
this is the code for that file
That the command does is strips away the windows \r and save over the original file and then executes the original file with out windows \r.
What I would like to do is pipe the the output from the command that strips away the windows \r through to the shell again without saving the file to disk.
The commands I have work in the terminal put trying to execute as them from a file does not.
Does any one have an idea how I can make this work?
I was thinking maybe using pipe would work better if i run the file through tr or sed can I get the output to fire at the end of the pipe can you show me some examples?
Hi I don't necessarily want to overwrite the input file. The script thaty I want to run just needs the window \r end of lines taken out before it fires.
Is there any way I could pass the out put of the tr command that takes out the window \r end of lines with pipe directly to the shell so that it just runs the script?
Thanks very much for your help
Is there any way I could pass the out put of the tr command that takes out the window \r end of lines with pipe directly to the shell so that it just runs the script?
Yes. The shell (sh, ksh, bash, etc) will read its script from the pipe if it's not provided as a command line argument.
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)
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)
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)
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)
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)
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)
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)
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)
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)