Hi, i've got the following:
a=`echo $b | grep '^.*/'`
i'm storing in the variable the value of the variable b only if it has a / somewhere.
It works, but i don't want to print the value. How do i give the value of b to the grep command without the echo?
thanks! (5 Replies)
I am performing a grep command and I need to know how to echo "NONE" or "0" to my file if grep does not find what i am looking for.
echo What i found >> My_File
grep "SOMETHING" >> My_File
I am sure this is easy, I am sort of new at this!
Thanks (2 Replies)
Hi,
I am cutting data from a fixed length test file and then writing out a new record using the echo command, the problem I have is how to stop multiple spaces from being written to the output file as a single space.
Example:
cat filea | while read line
do
field1=`echo $line | cut -c1-2`
... (6 Replies)
Hello,
well what I'm trying to do is to remove underscores from filenames and leaving empty spaces instead:
arturas@Universe:/windows/Center/training$ ls
big_file failas su shudu
arturas@Universe:/windows/Center/training$ a=big_file
arturas@Universe:/windows/Center/training$ mv $a `echo... (8 Replies)
Is there any way in a script to print out the commands being ran? In DOS script, there is the "@echo on" and "@echo off".
so I have a script like this:
#!/bin/ksh
echo "hello there. moving files."
<turn on echoing here>
cp thisfile.txt thatfile.txt
cp whatfile.prop whyfile.prop
<turn... (2 Replies)
My current line command is as follows:
echo -n "text: " ; grep "blah text" ../dir1/filename | wc -l
The output to the screen is as needed, but how do I print to a text file? (9 Replies)
Is there an environment issue that would not allow the following not store and pass the value into this field:
underScorePresent=`echo $USER | grep "_" | wc -l`
It is running on a new redhat 6.5 OS. The value $USER is set to cpac. It is a vendor code and they are saying it is environment... (1 Reply)
version info : Fedora 28 (Kernel version: 4.16.12-300)
shell : bash
Using echo command , if I redirect a text like "Chocolate" to a file , all the contents in the file are overwritten as shown below.
# cat /tmp/someTest
Hello world
One more Hello world
myLine3
# echo... (4 Replies)
Discussion started by: kraljic
4 Replies
LEARN ABOUT ULTRIX
ldlitem
ldlread(3x)ldlread(3x)Name
ldlread, ldlinit, ldlitem - manipulate line number entries of a common object file function
Syntax
#include <stdio.h>
#include <filehdr.h>
#include <syms.h>
#include <ldfcn.h>
int ldlread (ldptr, fcnindx, linenum, linent)
LDFILE *ldptr;
long fcnindx;
unsigned short linenum;
LINER linent;
int ldlinit (ldptr, fcnindx)
LDFILE *ldptr;
long fcnindx;
int ldlitem (ldptr, linenum, linent)
LDFILE *ldptr;
unsigned short linenum;
LINER linent;
Description
The function searches the line number entries of the common object file currently associated with ldptr. The function begins its search
with the line number entry for the beginning of a function and confines its search to the line numbers associated with a single function.
The function is identified by fcnindx, which is the index of its local symbols entry in the object file symbol table. The function reads
the entry with the smallest line number equal to or greater than linenum into linent.
The and functions provide the same behavior as After an initial call to or can be used to retrieve a series of line number entries associ-
ated with a single function. The function simply finds the line number entries for the function identified by fcnindx. The function finds
and reads the entry with the smallest line number equal to or greater than linenum into linent.
The functions and each return either success or failure. The function fails if one of the following occurs:
o If line number entries do not exist in the object file.
o If fcnindx does not index a function entry in the symbol table.
o If it does not find a line number equal to or greater than linenum.
The fails if it does not find a line number equal to or greater than linenum.
See Alsoldclose(3x), ldopen(3x), ldtbindex(3x), ldfcn(5)
RISC ldlread(3x)