9 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In the else of the main if condition .
else
set lnk = $(readlink -f <path> | cut -d '/' -f7)
echo "$lnk"
if ]
When I run the above on command line , the execution seems to be fine and I get the desired output. But when I try to assign it to a variable within a loop... (12 Replies)
Discussion started by: sankasu
12 Replies
2. Shell Programming and Scripting
I'm very much a newbie and hence why this is going to be a stupid question.
I'm attempting to create a korn shell script that pulls zone file locations and includes the copy command in the output. What?
getzonedir.ksh
#!/bin/ksh
while read -r domain
do ls */*"$domain" > $dir1
echo "cp... (5 Replies)
Discussion started by: djzah
5 Replies
3. Shell Programming and Scripting
Hi,
This is my input file
cat input
chr1:100-200
chr1:220-300
chr1:300-400
Now, I would like to run a program that will take each of the input record
for i in `cat input`; do program $i | wc -l;done
the output will be something like
10
20
30
But, I would like to print the... (4 Replies)
Discussion started by: jacobs.smith
4 Replies
4. Shell Programming and Scripting
Hi,
I'd like to assign the output of the find command to a variable.
What I need is to run the find command, and if it returns zero files, the program exits.
so i'm trying to assign the output of the find command to the $var1 variable....and then if this is less than one, I echo a... (2 Replies)
Discussion started by: horhif
2 Replies
5. Shell Programming and Scripting
I would like to redirect output of command line in for loop as $line.
Output should be processed as line but instead it throw whole output.
Could somebody help me on how to redirect output of command line and process it line by line without sending output to any file.
below is my code ... (1 Reply)
Discussion started by: tapia
1 Replies
6. Shell Programming and Scripting
Hi all
I run my program prog.c in the following way :
$ ./prog 1 > output.txt where 1 is a user defined initial value used by the program.
But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
Like
$ ./prog 1... (1 Reply)
Discussion started by: alice06
1 Replies
7. Programming
Hi, with this command:
cu -l /dev/ttyACM0 -s 9600 > name.txt
I put the output of the port in a txt
Is posible to do the same (or similar) in a var directly, inside a C program?
cu -l /dev/ttyACM0 -s 9600 > variable ?
I have trying this withs pipes, but i dont know how to... (6 Replies)
Discussion started by: daaran
6 Replies
8. Shell Programming and Scripting
If I run this command
networksetup -listallnetworkservices
I get the following output.
Ethernet
AirPort
*Parallels Host-Guest
*Parallels NAT
MY VPN
Ethernet 2
I want to make changes to only anything that contains the word "Ethernet" which I can do with grep.
But What I really need a... (6 Replies)
Discussion started by: elbombillo
6 Replies
9. Shell Programming and Scripting
With cut -c 8-13 myfile,
I am getting some numeric value.
In my shell script I am trying to assign something like this,
var=cut -c 8-13 myfile
But at the time of execution I am getting -c is not found.
If I dont assign, then script executes well.
Can we not simply use the value from one... (8 Replies)
Discussion started by: videsh77
8 Replies