Search Results

Search: Posts Made By: apmcd47
1,031
Posted By apmcd47
As I said in my earlier post you will have to see...
As I said in my earlier post you will have to see if you have a way to convert to text, such as "Edit Text and Images" menu option in Acrobat.

Andrew
1,031
Posted By apmcd47
This is probably a stupid question, but is your...
This is probably a stupid question, but is your PDF rendering text or an image, such a a scanned-in page, or text rendered to an image before being imported into the PDF? I'm not quite sure how you...
784
Posted By apmcd47
You don't say what system you are running this...
You don't say what system you are running this on. Assuming a Linux system and/or Gnu Date you could use something like:
2,260
Posted By apmcd47
If you use my second example you could just add a...
If you use my second example you could just add a second echo thus:
f=$(echo/var/chef/cache/cookbooks/bootstrap_cookbooks_version_*) && [ -f "$f" ] && echo ${f##*_} || echo "file does not exist"
In...
949
Posted By apmcd47
Two stage process not using ls: for f in...
Two stage process not using ls:
for f in status_*.log
do
f1="${%*_}
printf "%s\n" "${f1#.log}"
done
Which can be written as a single line:
for f in status_*.log; do f1="${%*_}; printf...
2,260
Posted By apmcd47
How about one of these two lines: [ -f...
How about one of these two lines:
[ -f /var/chef/cache/cookbooks/bootstrap_cookbooks_version_* ] && echo /var/chef/cache/cookbooks/bootstrap_cookbooks_version_* | sed 's/.*version_//'...
737
Posted By apmcd47
Try adding -g to the declare statement. The...
Try adding -g to the declare statement. The declare statement makes variable local to the function they are created in. The -g switch makes them global.


Use bash's help facility to find out more...
Forum: Programming 11-11-2019
2,708
Posted By apmcd47
realloc() is not guaranteed to reallocate in...
realloc() is not guaranteed to reallocate in situ, which is why you do
str = realloc(str, mem); rather than realloc(str, mem); The next_read variable should be reset with something like next_read =...
748
Posted By apmcd47
mygroup=$(groups $user) printf "User_name:...
mygroup=$(groups $user)
printf "User_name: \"$user\"\nGroup_name: \"%s\"\n" ${mygroup#*:}
You embed the username in the format string in printf. The ${mygroup#*:} strips everything to the left of...
568
Posted By apmcd47
A long time ago I used find ... cpio to create...
A long time ago I used find ... cpio to create tar archives. As it's a long time ago I can't find any examples, but using the GNU CPIO man page and evidence of how I used to copy directories with...
580
Posted By apmcd47
Could it be the space? Try00 03 * * 1-6...
Could it be the space? Try00 03 * * 1-6 /u01/script.sh >"/tmp/myfile_$(date +'%m_%d_%Y').log" 2>&1instead.

If that doesn't work, try puttingexec > "/tmp/myfile_$(date +'%m_%d_%Y').log"
exec 2>&1...
577
Posted By apmcd47
I've found a man page for libPW here...
I've found a man page for libPW here (http://www2.phys.canterbury.ac.nz/dept/docs/manuals/unix/DEC_4.0e_Docs/HTML/MAN/MAN3/1221____.HTM). Its use appears to be deprecated, which is probably why you...
2,965
Posted By apmcd47
Would name referencing be useful? This is...
Would name referencing be useful? This is Corona688's solution using namerefs:
#!/bin/ksh

set -A filelist val1 val2 val3
set -A otherlist q1 q2 q3

verifyfiles() {
nameref Flist=$1
...
2,763
Posted By apmcd47
Okay, then my point about piping into a while...
Okay, then my point about piping into a while statement creating a subshell was wrong - it is true for bash but not for ksh. I'm pretty sure my modifications will work for ksh.

Andrew
2,763
Posted By apmcd47
I was going to say I agree with RudiC, but...
I was going to say I agree with RudiC, but realise $LINE should be a subset of $1, not the other way round, so Rudi's solution probably won't get the results you want. So let's look at what is wrong...
3,704
Posted By apmcd47
GNU Zip will decompress .Z files, sogunzip -c...
GNU Zip will decompress .Z files, sogunzip -c somefile.tar.Z | tar xf -orzcat somefile.tar.Z | tar xf -should work without having to install the compress utility. It may even be possible to use GNU...
433
Posted By apmcd47
What happens if you don't put in all the white...
What happens if you don't put in all the white space?

--data $(printf '{"mName":"%s","oName":"%s"}' "$mname" "$oname")
Or use an intermediate variable:
json_data=$(printf...
433
Posted By apmcd47
--data $(printf '{"mName":"%s","oName":"%s"}'...
--data $(printf '{"mName":"%s","oName":"%s"}' "$mname" "$oname")may work too. Notice how I've used single quotes for the format string to preserve the double quotes without escaping them.

If that...
433
Posted By apmcd47
I've discovered a handy little tool called jq...
I've discovered a handy little tool called jq which can be used to build, display and manipulate JSON. If you are on Linux you can probably install it from the repository. Then you could change your...
1,543
Posted By apmcd47
Please give an example of what your output should...
Please give an example of what your output should look like. Because the file as listed has 0s and 1s on all lines, and therefore grep as you propose to use it will delete all lines,


Andrew
360
Posted By apmcd47
Be more precise with your queries. Check for a...
Be more precise with your queries. Check for a word in what? If I give you a word what do you want to do with it? When you check for today's date, do you mean find the first line with that date and...
360
Posted By apmcd47
Assuming GNU tail you can either list lines from...
Assuming GNU tail you can either list lines from the end (--lines=1234) or from the beginning (--lines=+1234) of the file. Thus listing the full file could be done withtail --lines=+1 myfile
In your...
2,272
Posted By apmcd47
Short of forking bash and modifying alias, I...
Short of forking bash and modifying alias, I don't think there is a way to do what you want. However, this bash function will pollute your environment with lots of aliases. To make things easier I...
2,755
Posted By apmcd47
Please state the operating system, including...
Please state the operating system, including version, and the shell you are using.

This works in ksh93 (Version AJM 93u+ 2012-08-01) on Ubuntu 18.04.3 LTS:
$ src=source_table_@ctry_final
$...
2,614
Posted By apmcd47
I gave you a pointer in your previous thread...
I gave you a pointer in your previous thread (https://www.unix.com/shell-programming-and-scripting/282404-guidance-required-profile.html) on this subject. Forcing a shell to source the .bashrc file...
Showing results 1 to 25 of 459

 

Featured Tech Videos

All times are GMT -4. The time now is 05:11 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy